Bug 1659567 - Add a memory reporter for gAccessCounts. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Tue, 18 Aug 2020 13:15:41 +0000
changeset 545125 25473dfe87715a98b1f35f5bb05e59c14429628b
parent 545124 5007c1c9c60c0b0d93ad11eedc89e629c4fab91c
child 545126 b528e9b6bab0bc66f79e9200bdbfe449573516e0
push id124397
push useramccreight@mozilla.com
push dateTue, 18 Aug 2020 15:50:08 +0000
treeherderautoland@25473dfe8771 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1659567
milestone81.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 1659567 - Add a memory reporter for gAccessCounts. r=froydnj This table is only in debug builds, but it takes up about 100kb, so it sticks out in DMD reports taken in debug builds. Differential Revision: https://phabricator.services.mozilla.com/D87347
modules/libpref/Preferences.cpp
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -3131,16 +3131,22 @@ PreferenceServiceReporter::CollectReport
   for (CallbackNode* node = gFirstCallback; node; node = node->Next()) {
     node->AddSizeOfIncludingThis(mallocSizeOf, sizes);
   }
 
   if (gSharedMap) {
     sizes.mMisc += mallocSizeOf(gSharedMap);
   }
 
+#ifdef ACCESS_COUNTS
+  if (gAccessCounts) {
+    sizes.mMisc += gAccessCounts->ShallowSizeOfIncludingThis(mallocSizeOf);
+  }
+#endif
+
   MOZ_COLLECT_REPORT("explicit/preferences/hash-table", KIND_HEAP, UNITS_BYTES,
                      sizes.mHashTable, "Memory used by libpref's hash table.");
 
   MOZ_COLLECT_REPORT("explicit/preferences/pref-values", KIND_HEAP, UNITS_BYTES,
                      sizes.mPrefValues,
                      "Memory used by PrefValues hanging off the hash table.");
 
   MOZ_COLLECT_REPORT("explicit/preferences/string-values", KIND_HEAP,