Bug 56395 - Web Inspector: [Chromium] Reduce memory consumption by detailed heap snapshots indexes
Summary: Web Inspector: [Chromium] Reduce memory consumption by detailed heap snapshot...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Mikhail Naganov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-15 11:49 PDT by Mikhail Naganov
Modified: 2011-03-17 10:49 PDT (History)
10 users (show)

See Also:


Attachments
patch (15.69 KB, patch)
2011-03-15 11:54 PDT, Mikhail Naganov
pfeldman: review+
mnaganov: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Naganov 2011-03-15 11:49:35 PDT
I optimized index structures used in detailed heap profiles. Generally, changing hash maps to arrays of sorted values saves a lot. Also, reversed graph wasn't stored optimally, effectively consuming almost the same amount of memory as the original graph does.

Making this change frees 30% memory when working with 2 snapshots of GMail, making diffs, and tracing paths to GC root (from 382353KB down to 264946KB).
Comment 1 Mikhail Naganov 2011-03-15 11:54:33 PDT
Created attachment 85836 [details]
patch
Comment 2 Pavel Feldman 2011-03-16 11:08:02 PDT
Comment on attachment 85836 [details]
patch

I hope this is covered with some test. Is it? Profiler is of scary size now.
Comment 3 Mikhail Naganov 2011-03-17 03:25:15 PDT
(In reply to comment #2)
> (From update of attachment 85836 [details])
> I hope this is covered with some test. Is it? Profiler is of scary size now.

I plan to add tests soon, because making such changes starts frightening myself.
Comment 4 Mikhail Naganov 2011-03-17 10:49:51 PDT
Manually committed: http://trac.webkit.org/changeset/81343


2011-03-17  Mikhail Naganov  <mnaganov@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: [Chromium] Reduce memory consumption by detailed heap snapshots indexes.
        https://bugs.webkit.org/show_bug.cgi?id=56395

        * inspector/front-end/DetailedHeapshotGridNodes.js:
        (WebInspector.HeapSnapshotDiffNode.prototype._createNodesProvider.createProvider):
        (WebInspector.HeapSnapshotDiffNode.prototype._createNodesProvider):
        * inspector/front-end/HeapSnapshot.js:
        (WebInspector.HeapSnapshotRetainerEdge): Added
        (WebInspector.HeapSnapshotRetainerEdgeIterator): Added
        (WebInspector.HeapSnapshotNode.prototype.get retainers):
        (WebInspector.HeapSnapshot.prototype.dispose):
        (WebInspector.HeapSnapshot.prototype.hasId):
        (WebInspector.HeapSnapshot.prototype.retainers):
        (WebInspector.HeapSnapshot.prototype._buildRetainers):
        (WebInspector.HeapSnapshot.prototype._buildIdsList):
        (WebInspector.HeapSnapshot.prototype._buildNodeIndex):
        (WebInspector.HeapSnapshot.prototype._findNodePositionInIndex):
        (WebInspector.HeapSnapshot.prototype._findNearestNodeIndex):
        (WebInspector.HeapSnapshot.prototype._getRetainerIndex):
        (WebInspector.HeapSnapshot.prototype._markInvisibleEdges):
        (WebInspector.HeapSnapshot.prototype._numbersComparator):
        (WebInspector.HeapSnapshotPathFinder.prototype.get _lastEdge):
        (WebInspector.HeapSnapshotPathFinder.prototype._nextEdgeIter):
        (WebInspector.HeapSnapshotPathFinder.prototype._buildNextPath):
        (WebInspector.HeapSnapshotPathFinder.prototype._pathToString):