Bug 1542263 - Measure the styleset memory usage from the document, not the pres shell.
☠☠ backed out by 40456af7da1c ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 08 Apr 2019 14:56:38 +0200
changeset 468343 b88166b3b314cda6ea94a0444d116c6b0321b6bd
parent 468342 9246cfa9fc3236804336650a80622fd6a1cc3146
child 468344 db1c74f43f924149f4790858c83d1803e0534846
push id35833
push userdvarga@mozilla.com
push dateMon, 08 Apr 2019 16:16:26 +0000
treeherdermozilla-central@50ce9167f1ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1542263
milestone68.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 1542263 - Measure the styleset memory usage from the document, not the pres shell.
dom/base/Document.cpp
layout/base/PresShell.cpp
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -11150,16 +11150,18 @@ void Document::DocAddSizeOfExcludingThis
   //
   // Therefore, the measurement of the Document superclass must happen after
   // the measurement of DOM nodes (above), because Document contains the
   // PresShell, which contains the frame tree.
   if (mPresShell) {
     mPresShell->AddSizeOfIncludingThis(aWindowSizes);
   }
 
+  mStyleSet->AddSizeOfIncludingThis(aWindowSizes);
+
   aWindowSizes.mDOMOtherSize += mLangGroupFontPrefs.SizeOfExcludingThis(
       aWindowSizes.mState.mMallocSizeOf);
 
   aWindowSizes.mPropertyTablesSize +=
       mPropertyTable.SizeOfExcludingThis(aWindowSizes.mState.mMallocSizeOf);
 
   if (EventListenerManager* elm = GetExistingListenerManager()) {
     aWindowSizes.mDOMEventListenersCount += elm->ListenerCount();
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -10554,18 +10554,16 @@ void PresShell::AddSizeOfIncludingThis(n
     aSizes.mLayoutPresShellSize += mCaret->SizeOfIncludingThis(mallocSizeOf);
   }
   aSizes.mLayoutPresShellSize +=
       mApproximatelyVisibleFrames.ShallowSizeOfExcludingThis(mallocSizeOf) +
       mFramesToDirty.ShallowSizeOfExcludingThis(mallocSizeOf) +
       mPendingScrollAnchorSelection.ShallowSizeOfExcludingThis(mallocSizeOf) +
       mPendingScrollAnchorAdjustment.ShallowSizeOfExcludingThis(mallocSizeOf);
 
-  StyleSet()->AddSizeOfIncludingThis(aSizes);
-
   aSizes.mLayoutTextRunsSize += SizeOfTextRuns(mallocSizeOf);
 
   aSizes.mLayoutPresContextSize +=
       mPresContext->SizeOfIncludingThis(mallocSizeOf);
 
   mFrameConstructor->AddSizeOfIncludingThis(aSizes);
 }