Bug 1551648 - Record peak resident memory usage in telemetry. r=erahm
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 23 May 2019 20:06:33 +0000
changeset 475289 af36f91523276c0e96596810dc480e1a5ae80921
parent 475288 61ae24d322cb05bec32cf7620778f15a2e6908e5
child 475290 53f2ffc77a62f878d0bd919dd1437debcd1f4371
push id86228
push userkgupta@mozilla.com
push dateThu, 23 May 2019 20:07:18 +0000
treeherderautoland@af36f9152327 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerserahm
bugs1551648
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551648 - Record peak resident memory usage in telemetry. r=erahm Differential Revision: https://phabricator.services.mozilla.com/D32184
toolkit/components/telemetry/Histograms.json
xpcom/base/MemoryTelemetry.cpp
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -1068,16 +1068,27 @@
     "expires_in_version": "never",
     "kind": "exponential",
     "low": 32768,
     "high": 16777216,
     "n_buckets": 100,
     "bug_numbers": [1226196],
     "description": "Resident memory size (KB)"
   },
+  "MEMORY_RESIDENT_PEAK": {
+    "record_in_processes": ["main", "content"],
+    "alert_emails": ["memshrink-telemetry-alerts@mozilla.com", "kgupta@mozilla.com"],
+    "expires_in_version": "never",
+    "kind": "exponential",
+    "low": 32768,
+    "high": 16777216,
+    "n_buckets": 100,
+    "bug_numbers": [1551648],
+    "description": "Peak resident memory size (KB)"
+  },
   "MEMORY_TOTAL": {
     "record_in_processes": ["main"],
     "alert_emails": ["memshrink-telemetry-alerts@mozilla.com", "erahm@mozilla.com"],
     "bug_numbers": [1198209, 1511918],
     "expires_in_version": "never",
     "kind": "exponential",
     "low": 32768,
     "high": 16777216,
--- a/xpcom/base/MemoryTelemetry.cpp
+++ b/xpcom/base/MemoryTelemetry.cpp
@@ -301,16 +301,17 @@ nsresult MemoryTelemetry::GatherReports(
   // asynchronously, on a background thread.
   RefPtr<Runnable> runnable = NS_NewRunnableFunction(
       "MemoryTelemetry::GatherReports", [mgr, completionRunnable]() mutable {
         RECORD(MEMORY_VSIZE, Vsize, UNITS_BYTES);
 #if !defined(HAVE_64BIT_BUILD) || !defined(XP_WIN)
         RECORD(MEMORY_VSIZE_MAX_CONTIGUOUS, VsizeMaxContiguous, UNITS_BYTES);
 #endif
         RECORD(MEMORY_RESIDENT_FAST, ResidentFast, UNITS_BYTES);
+        RECORD(MEMORY_RESIDENT_PEAK, ResidentPeak, UNITS_BYTES);
         RECORD(MEMORY_UNIQUE, ResidentUnique, UNITS_BYTES);
         RECORD(MEMORY_HEAP_ALLOCATED, HeapAllocated, UNITS_BYTES);
         RECORD(MEMORY_HEAP_OVERHEAD_FRACTION, HeapOverheadFraction,
                UNITS_PERCENTAGE);
 
         if (completionRunnable) {
           NS_DispatchToMainThread(completionRunnable.forget(),
                                   NS_DISPATCH_NORMAL);