Backed out changeset 622427e981a8 (bug 789975) for build bustage.

CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2013-01-14 22:13:24 -05:00
parent e1e12091ba
commit f291f53545
3 changed files with 10 additions and 55 deletions

View File

@ -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)

View File

@ -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":

View File

@ -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 <mach/mach_init.h>
@ -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<Telemetry::MEMORY_FREE_PURGED_PAGES_MS> 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 <windows.h>
@ -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