author | Andrew McCreight <continuation@gmail.com> |
Tue, 10 Sep 2013 08:56:36 -0700 | |
changeset 146441 | fb46afe7f48b31e86a5a78f2c0b7fa6ce25c9f2a |
parent 146440 | a36c944c929ed44a0ca361743cab150eca1be7c6 |
child 146442 | 08977d6b4bf19163ce52e6870156787c988af231 |
push id | 25260 |
push user | ryanvm@gmail.com |
push date | Wed, 11 Sep 2013 00:29:30 +0000 |
treeherder | mozilla-central@f73bed2856a8 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | njn |
bugs | 913881 |
milestone | 26.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
|
--- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -611,22 +611,24 @@ struct GCGraph { mNodes.Clear(); mEdges.Clear(); mWeakMaps.Clear(); mRootCount = 0; } void SizeOfExcludingThis(MallocSizeOf aMallocSizeOf, - size_t *aNodesSize, size_t *aEdgesSize) const { + size_t *aNodesSize, size_t *aEdgesSize, + size_t *aWeakMapsSize) const { *aNodesSize = mNodes.SizeOfExcludingThis(aMallocSizeOf); *aEdgesSize = mEdges.SizeOfExcludingThis(aMallocSizeOf); - // These fields are deliberately not measured: - // - mWeakMaps entries, because the pointers are non-owning + // We don't measure what the WeakMappings point to, because the + // pointers are non-owning. + *aWeakMapsSize = mWeakMaps.SizeOfExcludingThis(aMallocSizeOf); } }; static nsISupports * CanonicalizeXPCOMParticipant(nsISupports *in) { nsISupports* out; in->QueryInterface(NS_GET_IID(nsCycleCollectionISupports), @@ -971,16 +973,17 @@ public: nsCycleCollectorResults *aResults, nsICycleCollectorListener *aListener); void Shutdown(); void SizeOfIncludingThis(MallocSizeOf aMallocSizeOf, size_t *aObjectSize, size_t *aGraphNodesSize, size_t *aGraphEdgesSize, + size_t *aWeakMapsSize, size_t *aWhiteNodeSize, size_t *aPurpleBufferSize) const; private: void CheckThreadSafety(); void ShutdownCollect(nsICycleCollectorListener *aListener); void PrepareForCollection(nsCycleCollectorResults *aResults, @@ -2400,21 +2403,23 @@ class CycleCollectorMultiReporter MOZ_FI { name.AssignLiteral("cycle-collector"); return NS_OK; } NS_IMETHOD CollectReports(nsIMemoryMultiReporterCallback* aCb, nsISupports* aClosure) { - size_t objectSize, graphNodesSize, graphEdgesSize, whiteNodesSize, - purpleBufferSize; + size_t objectSize, graphNodesSize, graphEdgesSize, weakMapsSize, + whiteNodesSize, purpleBufferSize; mCollector->SizeOfIncludingThis(MallocSizeOf, - &objectSize, &graphNodesSize, - &graphEdgesSize, &whiteNodesSize, + &objectSize, + &graphNodesSize, &graphEdgesSize, + &weakMapsSize, + &whiteNodesSize, &purpleBufferSize); #define REPORT(_path, _amount, _desc) \ do { \ size_t amount = _amount; /* evaluate |_amount| only once */ \ if (amount > 0) { \ nsresult rv; \ rv = aCb->Callback(EmptyCString(), NS_LITERAL_CSTRING(_path), \ @@ -2431,16 +2436,21 @@ class CycleCollectorMultiReporter MOZ_FI REPORT("explicit/cycle-collector/graph-nodes", graphNodesSize, "Memory used for the nodes of the cycle collector's graph. " "This should be zero when the collector is idle."); REPORT("explicit/cycle-collector/graph-edges", graphEdgesSize, "Memory used for the edges of the cycle collector's graph. " "This should be zero when the collector is idle."); + REPORT("explicit/cycle-collector/weak-maps", weakMapsSize, + "Memory used for the representation of weak maps in the " + "cycle collector's graph. " + "This should be zero when the collector is idle."); + REPORT("explicit/cycle-collector/white-nodes", whiteNodesSize, "Memory used for the cycle collector's white nodes array. " "This should be zero when the collector is idle."); REPORT("explicit/cycle-collector/purple-buffer", purpleBufferSize, "Memory used for the cycle collector's purple buffer."); #undef REPORT @@ -2812,22 +2822,24 @@ nsCycleCollector::Shutdown() } } void nsCycleCollector::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf, size_t *aObjectSize, size_t *aGraphNodesSize, size_t *aGraphEdgesSize, + size_t *aWeakMapsSize, size_t *aWhiteNodeSize, size_t *aPurpleBufferSize) const { *aObjectSize = aMallocSizeOf(this); - mGraph.SizeOfExcludingThis(aMallocSizeOf, aGraphNodesSize, aGraphEdgesSize); + mGraph.SizeOfExcludingThis(aMallocSizeOf, aGraphNodesSize, aGraphEdgesSize, + aWeakMapsSize); // No need to measure what the entries point to; the pointers are // non-owning. *aWhiteNodeSize = mWhiteNodes ? mWhiteNodes->SizeOfIncludingThis(aMallocSizeOf) : 0; *aPurpleBufferSize = mPurpleBuf.SizeOfExcludingThis(aMallocSizeOf);