Closed Bug 625846 (heap) Opened 13 years ago Closed 6 years ago

Add Heap Snapshot and Analysis tools

Categories

(DevTools :: Memory, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jrmuizel, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Whiteboard: [performance] [shumway])

User Story

As a developer, I would like to be able to analyze a full heap snapshot so that I can get a better understanding of the memory behavior of my application. 

This is a broad user story, will do specifics in individual user stories.

Attachments

(1 file)

Chrome has a heap snapshot tool that tells you where memory is being spent on a particular page. We should get this.
Summary: Add Heap Snapshot → Add Heap Snapshot tool
There are probably half a dozen bugs on this, but the one that looks most promising at the moment is Bug 625305.
(In reply to comment #1)
> There are probably half a dozen bugs on this, but the one that looks most
> promising at the moment is Bug 625305.

Nope, that one is different. Chrome's tool is a snapshot for a particular page and breaks down the memory usage per object. Bug 625305 will only tell which page is using memory and not really give you any help in fixing it.
Blocks: 640763
Whiteboard: [console-1]
Whiteboard: [console-1]
Whiteboard: [MemShrink:P2]
Hardware: x86 → All
Version: unspecified → Trunk
Hardware: All → x86
Whiteboard: [MemShrink:P2]
Version: Trunk → unspecified
I removed the MemShrink annotation because this more a user-facing dev tool than a "the browser needs to be slimmer" tool.
Hardware: x86 → All
Version: unspecified → Trunk
The blog post has a good summary of using Chrome's tool:
http://gent.ilcore.com/2011/08/finding-memory-leaks.html
One possibly fun twist here would be to allow user-defined predicates, written in JS, to distinguish JS Objects, which are otherwise just going to be a giant blob.
Type inference has boat-loads of information about objects;  I bet that could be utilized somehow.
Found during bug triage (nearly a year later).

This is definitely something I would love to have. CC'ing Shu for his Type Inference interests.
Whiteboard: [performance]
Alias: heap
Summary: Add Heap Snapshot tool → Add Heap Snapshot and Analysis tools
Is this still on the devtools team's radar? Debugging the memory allocation patterns in Shumway would be greatly helped by having such a tool.
No longer blocks: 646734, 646737, 646739
Depends on: 646734, 646737, 646739
Whiteboard: [performance] → [performance] [shumway]
Blocks: perf-kanban
Adding this to the performance Kanban. Need to log user stories associated with a heap tool. The main user story is to find memory leaks without having to record. 

As a app/web developer I would like to find memory leaks without having to run a recording so that I don't have to fill up my hard drive with useless data and so that I can find long term memory leaks.

Acceptance criteria: 
- Be able to take heap snapshots
- be able to do diffs on the snapshots
Flags: pm-scrub?
I'm working on memory tracking and it would be extremely useful for me.

I'm attaching a screenshot of how this looks in Chrome DevTools.

Here's the description:

What I see on top is that there's an object (@50971) which uses 153kb of memory. Objects in total use 507kb, but that's the single biggest one.

When I unfold it I see that it has tons of strings - it's our localization entries object.
Now I see how it's structured.

At the bottom I see that it's retained because of a reference from a variable "entries" which is referenced from a variable context which is referenced by an Array and Window object itself.

That's super helpful.

I can also wait a few seconds and do another snapshot and compare which objects were removed, added or modified and how it affected memory consumption. That's also useful.

One thing that I miss heavily is ability to filter objects by file they were defined in.
Component: Developer Tools → Developer Tools: Memory
Flags: pm-scrub?
Converting this to a user story to capture all the dependent user stories for heap snapshot analysis.
Component: Developer Tools: Memory → Developer Tools: User Stories
User Story: (updated)
Blocks: mem-diff
Component: Developer Tools: User Stories → Developer Tools: Memory
We've had a memory panel in the devtools for a while now. Anything more specific should be filed as new bugs. Thanks!
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Product: Firefox → DevTools
Blocks: heapprof
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: