Title: [137457] trunk/Source
Revision
137457
Author
[email protected]
Date
2012-12-12 05:32:48 -0800 (Wed, 12 Dec 2012)

Log Message

Web Inspector: add memory used by memory allocator itself to NMI
https://bugs.webkit.org/show_bug.cgi?id=93372

Make native memory instrumentation report memory retained
for the memory allocator internal purposes.

Patch by Alexei Filippov <[email protected]> on 2012-12-12
Reviewed by Yury Semikhatsky.

Source/Platform:

* chromium/public/Platform.h:
(Platform):
(WebKit::Platform::memoryAllocatorWasteInBytes):

Source/WebCore:

* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.MemoryBlockViewProperties._initialize):
* platform/chromium/MemoryUsageSupportChromium.cpp:
(WebCore::MemoryUsageSupport::memoryUsageByComponents):

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (137456 => 137457)


--- trunk/Source/Platform/ChangeLog	2012-12-12 13:31:13 UTC (rev 137456)
+++ trunk/Source/Platform/ChangeLog	2012-12-12 13:32:48 UTC (rev 137457)
@@ -1,3 +1,17 @@
+2012-12-12  Alexei Filippov  <[email protected]>
+
+        Web Inspector: add memory used by memory allocator itself to NMI
+        https://bugs.webkit.org/show_bug.cgi?id=93372
+
+        Make native memory instrumentation report memory retained
+        for the memory allocator internal purposes.
+
+        Reviewed by Yury Semikhatsky.
+
+        * chromium/public/Platform.h:
+        (Platform):
+        (WebKit::Platform::memoryAllocatorWasteInBytes):
+
 2012-12-12  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Change the data channel descriptor pattern to a handler pattern

Modified: trunk/Source/Platform/chromium/public/Platform.h (137456 => 137457)


--- trunk/Source/Platform/chromium/public/Platform.h	2012-12-12 13:31:13 UTC (rev 137456)
+++ trunk/Source/Platform/chromium/public/Platform.h	2012-12-12 13:32:48 UTC (rev 137457)
@@ -212,7 +212,11 @@
     // false on platform specific error conditions.
     virtual bool processMemorySizesInBytes(size_t* privateBytes, size_t* sharedBytes) { return false; }
 
+    // Reports number of bytes used by memory allocator for internal needs.
+    // Returns true if the size has been reported, or false otherwise.
+    virtual bool memoryAllocatorWasteInBytes(size_t*) { return false; }
 
+
     // Message Ports -------------------------------------------------------
 
     // Creates a Message Port Channel. This can be called on any thread.

Modified: trunk/Source/WebCore/ChangeLog (137456 => 137457)


--- trunk/Source/WebCore/ChangeLog	2012-12-12 13:31:13 UTC (rev 137456)
+++ trunk/Source/WebCore/ChangeLog	2012-12-12 13:32:48 UTC (rev 137457)
@@ -1,3 +1,18 @@
+2012-12-12  Alexei Filippov  <[email protected]>
+
+        Web Inspector: add memory used by memory allocator itself to NMI
+        https://bugs.webkit.org/show_bug.cgi?id=93372
+
+        Make native memory instrumentation report memory retained
+        for the memory allocator internal purposes.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/NativeMemorySnapshotView.js:
+        (WebInspector.MemoryBlockViewProperties._initialize):
+        * platform/chromium/MemoryUsageSupportChromium.cpp:
+        (WebCore::MemoryUsageSupport::memoryUsageByComponents):
+
 2012-12-12  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r137438.

Modified: trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js (137456 => 137457)


--- trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js	2012-12-12 13:31:13 UTC (rev 137456)
+++ trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js	2012-12-12 13:32:48 UTC (rev 137457)
@@ -396,6 +396,7 @@
     addBlock("hsl( 40, 80%,  80%)", "GlyphCache", "Glyph cache resources");
     addBlock("hsl( 35, 80%,  80%)", "DOMStorageCache", "DOM storage cache");
     addBlock("hsl( 60, 80%,  60%)", "RenderTree", "Render tree");
+    addBlock("hsl( 20, 80%,  50%)", "MallocWaste", "Memory allocator waste");
 }
 
 WebInspector.MemoryBlockViewProperties._forMemoryBlock = function(memoryBlock)

Modified: trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp (137456 => 137457)


--- trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp	2012-12-12 13:31:13 UTC (rev 137456)
+++ trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp	2012-12-12 13:32:48 UTC (rev 137457)
@@ -70,6 +70,9 @@
 {
     size_t size = SkGraphics::GetFontCacheUsed();
     components.append(ComponentInfo("GlyphCache", size));
+
+    if (WebKit::Platform::current()->memoryAllocatorWasteInBytes(&size))
+        components.append(ComponentInfo("MallocWaste", size));
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to