Bug 158086 - Web Inspector: console.takeHeapSnapshot takes snapshots even if allocations timeline is not enabled or not recording
Summary: Web Inspector: console.takeHeapSnapshot takes snapshots even if allocations t...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-05-25 14:02 PDT by Brian Burg
Modified: 2016-12-13 15:39 PST (History)
3 users (show)

See Also:


Attachments
[HTML] reduction (133 bytes, text/html)
2016-05-25 14:02 PDT, Brian Burg
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Burg 2016-05-25 14:02:59 PDT
Created attachment 279806 [details]
[HTML] reduction

STEPS TO REPRODUCE:

0. Open the page
1. Open the inspector
2. Show the allocations timeline

EXPECTED:

Nothing shows up

ACTUAL:

Lots of snapshots populate the timeline even if not recording
Comment 1 Joseph Pecoraro 2016-05-25 14:19:29 PDT
I think this is expected. Like other console commands, they do nothing if Web Inspector is not open, but do things when Web Inspector is open. The same here. Requiring that someone be recording would be rather annoying.

That said, I can see how showing the [S] in the Timeline randomly popping up would be rather annoying.
Comment 2 Brian Burg 2016-05-25 15:58:05 PDT
Poke for the importer.
Comment 3 Timothy Hatcher 2016-05-25 16:01:28 PDT
This does match console.profile, which is the behavior I talked to Joe about following. I would consider this behaves correctly.
Comment 4 Brian Burg 2016-05-25 16:18:55 PDT
(In reply to comment #3)
> This does match console.profile, which is the behavior I talked to Joe about
> following. I would consider this behaves correctly.

Ok. I did find it very jarring to see my timeline fill up with snapshots without having done anything on my part.
Comment 5 Brian Burg 2016-05-25 16:19:35 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > This does match console.profile, which is the behavior I talked to Joe about
> > following. I would consider this behaves correctly.
> 
> Ok. I did find it very jarring to see my timeline fill up with snapshots
> without having done anything on my part.

But then, does toggling the Allocations timeline only change whether it's visible?
Comment 6 Timothy Hatcher 2016-05-25 17:07:24 PDT
No, console.takeHeapSnapshot forces it on. If that isn't used, it will remain off and high performance.

I could buy the argument that console.profile and console.takeHeapSnapshot should only work if the timeline is already enabled. That way you can basically make console.profile and console.takeHeapSnapshot no-ops if you disable the right timelines.
Comment 7 Brian Burg 2016-05-27 07:19:50 PDT
(In reply to comment #6)
> No, console.takeHeapSnapshot forces it on. If that isn't used, it will
> remain off and high performance.
> 
> I could buy the argument that console.profile and console.takeHeapSnapshot
> should only work if the timeline is already enabled. That way you can
> basically make console.profile and console.takeHeapSnapshot no-ops if you
> disable the right timelines.

I would like there to be a way to disable it from within the inspector, otherwise it will cause GC to take way longer, and we wouldn't be able to get useful script profiles.
Comment 8 Radar WebKit Bug Importer 2016-05-27 07:24:20 PDT
<rdar://problem/26516717>