How to use performance.memory API ?

3,880 views
Skip to first unread message

Liu Xiao

unread,
Sep 13, 2014, 3:20:13 AM9/13/14
to google-chrome-...@googlegroups.com
Dear All:

How to use performance.memory API to get the variation of heap?

First, I run window.performance.memory in the Console of DevTools, it gives result as follow:
MemoryInfo {jsHeapSizeLimit: 1620000000, usedJSHeapSize: 10000000, totalJSHeapSize: 19300000}

Then, I allocate lots of memory by JavaScript and run it again, but the given result don't change. 
MemoryInfo {jsHeapSizeLimit: 1620000000, usedJSHeapSize: 10000000, totalJSHeapSize: 19300000}

But by the Heap Snapshot, it indeed increases to 24.8MB. 

And by Timeline, it also indeed increases. 

How do I understand the result?

Thank you very much.


Ilya Tikhonovsky

unread,
Sep 17, 2014, 10:53:58 AM9/17/14
to google-chrome-...@googlegroups.com
You need to run chrome with --enable-memory-info flag.


--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/951b42f2-8b5c-44c9-8216-a26e5620429e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mikhail Naganov

unread,
Oct 21, 2014, 12:29:16 PM10/21/14
to Google Chrome Developer Tools
BTW, we have killed this flag as a part of "flags cleanup" effort, see http://crbug.com/350339

So the only way to watch for detailed memory consumption deltas is to use Heap Profiler.

jah...@groupon.com

unread,
Dec 10, 2014, 4:24:13 PM12/10/14
to google-chrome-...@googlegroups.com, mnag...@chromium.org
What about --enable-precise-memory-info?

PhistucK

unread,
Dec 11, 2014, 1:36:56 AM12/11/14
to Google Chrome Developer Tools, Mikhail Naganov, Peter Kasting
The comment seems to suggest that this new (May, 2014) flag only works for Workers​ (Shared or otherwise)?
This is the issue - crbug.com/326370.
This seems to have been added after the cleanup has started (February, 2014). Given that the previous flag went away in the cleanup, I am not sure this flag is acceptable in the long term...


PhistucK

On Wed, Dec 10, 2014 at 11:24 PM, <jah...@groupon.com> wrote:
What about --enable-precise-memory-info?

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages