Summary: | Web Inspector: We should have a way to capture heap snapshots programatically. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Mark Lam <mark.lam> | ||||||||
Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | bburg, commit-queue, dino, ggaren, graouts, joepeck, keith_miller, mark.lam, mattbaker, msaboff, nvasilyev, saam, timothy, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | WebKit Local Build | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 10930 | ||||||||||
Attachments: |
|
Description
Mark Lam
2016-02-18 12:50:13 PST
I'd suggest something like: console.heapSnapshot(name); Which is similar to how we do programmatic JavaScript profiles: console.profile(name) console.profileEnd(name) Looks like Microsoft already has: <https://msdn.microsoft.com/en-us/library/windows/apps/jj819176(v=vs.120).aspx#SnapshotDetails> console.takeHeapSnapshot So we can use that to be consistent! Created attachment 274364 [details]
[PATCH] Proposed Fix
This adds console.takeHeapSnapshot. It will only work if:
1. The inspector is open
2. The inspector's Timeline tab has the Heap Allocations timeline (currently this is always)
NOTE: You do not need to be recording.
We may want to provide an alternative, like a Console Message that you can click on to show the snapshot Content View.
Mozilla bug for this: Implement console.takeHeapSnapshot https://bugzilla.mozilla.org/show_bug.cgi?id=960662 Chrome bug for this: No JavaScript call to trigger a heap snapshot https://bugs.chromium.org/p/chromium/issues/detail?id=31516 Created attachment 274366 [details]
[PATCH] Proposed Fix
Created attachment 275109 [details]
[PATCH] For Landing
Comment on attachment 275109 [details] [PATCH] For Landing Clearing flags on attachment: 275109 Committed r198786: <http://trac.webkit.org/changeset/198786> |