From f291f53545d04038272c625966ce47ae0344e230 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Mon, 14 Jan 2013 22:13:24 -0500 Subject: [PATCH] Backed out changeset 622427e981a8 (bug 789975) for build bustage. CLOSED TREE --- .../aboutmemory/content/aboutMemory.js | 13 +---- toolkit/components/telemetry/TelemetryPing.js | 2 +- xpcom/base/nsMemoryReporterManager.cpp | 50 +++---------------- 3 files changed, 10 insertions(+), 55 deletions(-) diff --git a/toolkit/components/aboutmemory/content/aboutMemory.js b/toolkit/components/aboutmemory/content/aboutMemory.js index aa87e9d3672f..ffe4d0a31978 100644 --- a/toolkit/components/aboutmemory/content/aboutMemory.js +++ b/toolkit/components/aboutmemory/content/aboutMemory.js @@ -720,23 +720,12 @@ function getTreesByProcess(aProcessMemoryReports, aTreesByProcess, // "ghost-windows" multi-reporters all the time. (Note that reports from // these multi-reporters can reach here as single reports if they were in the // child process.) - // - // Also ignore the resident-fast reporter; we use the vanilla resident - // reporter because it's more important that we get accurate results than - // that we avoid the (small) possibility of a long pause when loading - // about:memory. - // - // We don't show both resident and resident-fast because running the resident - // reporter can purge pages on MacOS, which affects the results of the - // resident-fast reporter. We don't want about:memory's results to be - // affected by the order of memory reporter execution. function ignoreSingle(aUnsafePath) { return (isSmapsPath(aUnsafePath) && !gVerbose && !aForceShowSmaps) || aUnsafePath.startsWith("compartments/") || - aUnsafePath.startsWith("ghost-windows/") || - aUnsafePath == "resident-fast"; + aUnsafePath.startsWith("ghost-windows/"); } function ignoreMulti(aMRName) diff --git a/toolkit/components/telemetry/TelemetryPing.js b/toolkit/components/telemetry/TelemetryPing.js index f99a39a048ed..a682ad8378b9 100644 --- a/toolkit/components/telemetry/TelemetryPing.js +++ b/toolkit/components/telemetry/TelemetryPing.js @@ -56,7 +56,7 @@ const MEM_HISTOGRAMS = { "js-compartments/system": "MEMORY_JS_COMPARTMENTS_SYSTEM", "js-compartments/user": "MEMORY_JS_COMPARTMENTS_USER", "explicit": "MEMORY_EXPLICIT", - "resident-fast": "MEMORY_RESIDENT", + "resident": "MEMORY_RESIDENT", "vsize": "MEMORY_VSIZE", "storage-sqlite": "MEMORY_STORAGE_SQLITE", "images-content-used-uncompressed": diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index c43016913beb..8f5907f00dc2 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -242,11 +242,6 @@ static nsresult GetResident(int64_t *n) return NS_OK; } -static nsresult GetResidentFast(int64_t *n) -{ - return GetResident(n); -} - #elif defined(XP_MACOSX) #include @@ -274,17 +269,16 @@ static nsresult GetVsize(int64_t *n) return NS_OK; } -// If we're using jemalloc on Mac, we need to instruct jemalloc to purge the -// pages it has madvise(MADV_FREE)'d before we read our RSS in order to get -// an accurate result. The OS will take away MADV_FREE'd pages when there's -// memory pressure, so ideally, they shouldn't count against our RSS. -// -// Purging these pages can take a long time for some users (see bug 789975), -// so we provide the option to get the RSS without purging first. -static nsresult GetResident(int64_t *n, bool aDoPurge) +static nsresult GetResident(int64_t *n) { #ifdef HAVE_JEMALLOC_STATS - if (aDoPurge) + // If we're using jemalloc on Mac, we need to instruct jemalloc to purge + // the pages it has madvise(MADV_FREE)'d before we read our RSS. The OS + // will take away MADV_FREE'd pages when there's memory pressure, so they + // shouldn't count against our RSS. + // + // Purging these pages shouldn't take more than 10ms or so, but we want to + // keep an eye on it since GetResident() is called on each Telemetry ping. { Telemetry::AutoTimer timer; jemalloc_purge_freed_pages(); @@ -299,16 +293,6 @@ static nsresult GetResident(int64_t *n, bool aDoPurge) return NS_OK; } -static nsresult GetResidentFast(int64_t *n) -{ - return GetResident(n, /* doPurge = */ false); -} - -static nsresult GetResident(int64_t *n) -{ - return GetResident(n, /* doPurge = */ true); -} - #elif defined(XP_WIN) #include @@ -341,11 +325,6 @@ static nsresult GetResident(int64_t *n) return NS_OK; } -static nsresult GetResidentFast(int64_t *n) -{ - return GetResident(n); -} - #define HAVE_PRIVATE_REPORTER static nsresult GetPrivate(int64_t *n) { @@ -398,18 +377,6 @@ NS_FALLIBLE_MEMORY_REPORTER_IMPLEMENT(Resident, "but it depends both on other processes being run and details of the OS " "kernel and so is best used for comparing the memory usage of a single " "process at different points in time.") - -NS_FALLIBLE_MEMORY_REPORTER_IMPLEMENT(ResidentFast, - "resident-fast", - KIND_OTHER, - UNITS_BYTES, - GetResidentFast, - "This reporter measures the same value as the resident memory reporter, but " - "it tries to be as fast as possible, at the expense of accuracy. On most " - "platforms this is identical to the vanilla resident reporter, but on MacOS" - "in particular, this reporter may over-count our RSS. You should use " - "resident-fast where you care about latency of collection (e.g. in " - "telemetry). Otherwise you should use the regular resident reporter.") #endif // HAVE_VSIZE_AND_RESIDENT_REPORTERS #ifdef HAVE_PAGE_FAULT_REPORTERS @@ -698,7 +665,6 @@ nsMemoryReporterManager::Init() #ifdef HAVE_VSIZE_AND_RESIDENT_REPORTERS REGISTER(Vsize); REGISTER(Resident); - REGISTER(ResidentFast); #endif #ifdef HAVE_PAGE_FAULT_REPORTERS