diff --git a/toolkit/components/aboutmemory/tests/test_aboutmemory5.xul b/toolkit/components/aboutmemory/tests/test_aboutmemory5.xul index 50a464310cce..9aa61e290a66 100644 --- a/toolkit/components/aboutmemory/tests/test_aboutmemory5.xul +++ b/toolkit/components/aboutmemory/tests/test_aboutmemory5.xul @@ -104,7 +104,8 @@ // If we have more than 1000 chars, we've probably successfully // copy+pasted. if (actual.length > 1000) { - let vsizes = actual.match(/vsize/g); + // Note: Match "vsize" but not "vsize-max-contiguous". + let vsizes = actual.match(/vsize[^-]/g); let endOfBrowsers = actual.match(/End of Browser/g); if (vsizes.length == 4 && endOfBrowsers.length == 3) { diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp index 2253d32983d2..a6594960fa33 100644 --- a/xpcom/base/nsMemoryReporterManager.cpp +++ b/xpcom/base/nsMemoryReporterManager.cpp @@ -400,6 +400,20 @@ static nsresult GetVsizeMaxContiguous(int64_t* aN) return NS_OK; } +class VsizeMaxContiguousReporter MOZ_FINAL : public MemoryUniReporter +{ +public: + VsizeMaxContiguousReporter() + : MemoryUniReporter("vsize-max-contiguous", KIND_OTHER, UNITS_BYTES, +"Size of the maximum contiguous block of available virtual memory.") + {} + + NS_IMETHOD GetAmount(int64_t* aAmount) + { + return GetVsizeMaxContiguous(aAmount); + } +}; + #define HAVE_PRIVATE_REPORTER class PrivateReporter MOZ_FINAL : public MemoryUniReporter { @@ -778,6 +792,10 @@ nsMemoryReporterManager::Init() RegisterReporter(new ResidentReporter); #endif +#ifdef HAVE_VSIZE_MAX_CONTIGUOUS_REPORTER + RegisterReporter(new VsizeMaxContiguousReporter); +#endif + #ifdef HAVE_RESIDENT_UNIQUE_REPORTER RegisterReporter(new ResidentUniqueReporter); #endif