Changeset 120589 in webkit


Ignore:
Timestamp:
Jun 18, 2012 4:40:47 AM (12 years ago)
Author:
loislo@chromium.org
Message:

Web Inspector: Add heap profiler owned memory to the pie chart
https://bugs.webkit.org/show_bug.cgi?id=89203

Heap profiler may consume considerable amount of memory
which is currently falls into Unknown category.
Give it a separate sector on the pie chart.

Patch by Alexei Filippov <alexeif@chromium.org> on 2012-06-18
Reviewed by Yury Semikhatsky.

  • bindings/js/ScriptProfiler.h:

(WebCore::ScriptProfiler::profilerSnapshotsSize):

  • bindings/v8/ScriptProfiler.cpp:

(WebCore::ScriptProfiler::profilerSnapshotsSize):
(WebCore):

  • bindings/v8/ScriptProfiler.h:

(ScriptProfiler):

  • inspector/InspectorMemoryAgent.cpp:

(MemoryBlockName):
(WebCore):
(WebCore::inspectorData):
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):

  • inspector/front-end/NativeMemorySnapshotView.js:

(WebInspector.MemoryBlockViewProperties._initialize):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r120588 r120589  
     12012-06-18  Alexei Filippov  <alexeif@chromium.org>
     2
     3        Web Inspector: Add heap profiler owned memory to the pie chart
     4        https://bugs.webkit.org/show_bug.cgi?id=89203
     5
     6        Heap profiler may consume considerable amount of memory
     7        which is currently falls into Unknown category.
     8        Give it a separate sector on the pie chart.
     9
     10        Reviewed by Yury Semikhatsky.
     11
     12        * bindings/js/ScriptProfiler.h:
     13        (WebCore::ScriptProfiler::profilerSnapshotsSize):
     14        * bindings/v8/ScriptProfiler.cpp:
     15        (WebCore::ScriptProfiler::profilerSnapshotsSize):
     16        (WebCore):
     17        * bindings/v8/ScriptProfiler.h:
     18        (ScriptProfiler):
     19        * inspector/InspectorMemoryAgent.cpp:
     20        (MemoryBlockName):
     21        (WebCore):
     22        (WebCore::inspectorData):
     23        (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
     24        * inspector/front-end/NativeMemorySnapshotView.js:
     25        (WebInspector.MemoryBlockViewProperties._initialize):
     26
    1272012-06-18  Mario Sanchez Prada  <msanchez@igalia.com>
    228
  • trunk/Source/WebCore/bindings/js/ScriptProfiler.h

    r116768 r120589  
    7575    static void visitJSDOMWrappers(DOMWrapperVisitor*) { }
    7676    static void visitExternalJSStrings(DOMWrapperVisitor*) { }
     77    static size_t profilerSnapshotsSize() { return 0; }
    7778};
    7879
  • trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp

    r116768 r120589  
    197197}
    198198
     199size_t ScriptProfiler::profilerSnapshotsSize()
     200{
     201    return v8::HeapProfiler::GetMemorySizeUsedByProfiler();
     202}
     203
    199204} // namespace WebCore
    200205
  • trunk/Source/WebCore/bindings/v8/ScriptProfiler.h

    r116768 r120589  
    7979    static void visitJSDOMWrappers(DOMWrapperVisitor*);
    8080    static void visitExternalJSStrings(DOMWrapperVisitor*);
     81    static size_t profilerSnapshotsSize();
    8182};
    8283
  • trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp

    r120044 r120589  
    6767static const char jsHeapAllocated[] = "JSHeapAllocated";
    6868static const char jsHeapUsed[] = "JSHeapUsed";
     69static const char inspectorData[] = "InspectorData";
    6970static const char memoryCache[] = "MemoryCache";
    7071static const char processPrivateMemory[] = "ProcessPrivateMemory";
     
    348349}
    349350
     351static PassRefPtr<InspectorMemoryBlock> inspectorData()
     352{
     353    size_t dataSize = ScriptProfiler::profilerSnapshotsSize();
     354    RefPtr<InspectorMemoryBlock> inspectorData = InspectorMemoryBlock::create().setName(MemoryBlockName::inspectorData);
     355    inspectorData->setSize(static_cast<int>(dataSize));
     356    return inspectorData.release();
     357}
     358
    350359static PassRefPtr<InspectorMemoryBlock> renderTreeInfo(Page* page)
    351360{
     
    402411    RefPtr<TypeBuilder::Array<InspectorMemoryBlock> > children = TypeBuilder::Array<InspectorMemoryBlock>::create();
    403412    children->addItem(jsHeapInfo());
     413    children->addItem(inspectorData());
    404414    children->addItem(memoryCacheInfo());
    405415    children->addItem(renderTreeInfo(m_page)); // TODO: collect for all pages?
  • trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js

    r120579 r120589  
    215215        WebInspector.MemoryBlockViewProperties._standardBlocks[name] = new WebInspector.MemoryBlockViewProperties(fillStyle, name, WebInspector.UIString(description));
    216216    }
    217     addBlock("rgba(255, 255, 255, 0.8)", "ProcessPrivateMemory", "Total");
    218     addBlock("rgba(240, 240, 250, 0.8)", "Other", "Other");
    219     addBlock("rgba(250, 200, 200, 0.8)", "JSHeapAllocated", "JavaScript heap");
    220     addBlock("rgba(200, 250, 200, 0.8)", "JSHeapUsed", "Used JavaScript heap");
    221     addBlock("rgba(200, 170, 200, 0.8)", "MemoryCache", "Memory cache resources");
    222     addBlock("rgba(250, 250, 150, 0.8)", "RenderTreeAllocated", "Render tree");
    223     addBlock("rgba(200, 150, 150, 0.8)", "RenderTreeUsed", "Render tree used");
     217    addBlock("hsl(  0,  0%, 100%)", "ProcessPrivateMemory", "Total");
     218    addBlock("hsl(  0,  0%,  80%)", "Other", "Other");
     219    addBlock("hsl( 90, 60%,  80%)", "JSHeapAllocated", "JavaScript heap");
     220    addBlock("hsl( 90, 80%,  80%)", "JSHeapUsed", "Used JavaScript heap");
     221    addBlock("hsl(210, 60%,  80%)", "InspectorData", "Inspector data");
     222    addBlock("hsl( 30, 60%,  80%)", "MemoryCache", "Memory cache resources");
     223    addBlock("hsl( 60, 60%,  80%)", "RenderTreeAllocated", "Render tree");
     224    addBlock("hsl( 60, 60%,  80%)", "RenderTreeUsed", "Render tree used");
    224225}
    225226
Note: See TracChangeset for help on using the changeset viewer.