Summary: | Web Inspector: retained size for typed arrays does not count native backing store | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | BJ Burg <bburg> | ||||||
Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bburg, commit-queue, fpizlo, ggaren, graouts, joepeck, keith_miller, mark.lam, mattbaker, msaboff, nvasilyev, saam, timothy, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=78574 | ||||||||
Attachments: |
|
Description
BJ Burg
2016-05-20 09:32:52 PDT
Created attachment 279483 [details]
[SCREENSHOT] Bad timeline data
I guess this is a specific type of TypedArray that we do not get the size correctly. For a basic: new Uint32Array(5000); I'm seeing it get a size of 19.56kb. So there must be something non-trivial about the arrays on that page. Ahh, I see the issue when using a Buffer and View separately: window.lists = []; console.takeHeapSnapshot("before"); var buffer = new ArrayBuffer(4*5000); var view = new Float32Array(buffer); window.lists.push(view); console.takeHeapSnapshot("after"); Neither the ArrayBuffer or the Float32Array claiming the data! Looks like JSArrayBuffer doesn't report an estimated size. I missed it because ArrayBuffer's have their own unique reporting of their size to the Heap. Created attachment 279501 [details]
[PATCH] Proposed Fix
Note, with this change, the memory will be associated with the ArrayBuffer.
There currently does not exist a way to know if the Float32Array is the only retainer of the ArrayBuffer, so the Float32Array's will still appear small. That means they are just a view on an ArrayBuffer.
Comment on attachment 279501 [details]
[PATCH] Proposed Fix
r=me
Comment on attachment 279501 [details] [PATCH] Proposed Fix Clearing flags on attachment: 279501 Committed r201226: <http://trac.webkit.org/changeset/201226> All reviewed patches have been landed. Closing bug. |