Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Heap Snapshot - Why it doesn't show all the memory allocated?

Tags:

I'm running some memory usage tests in a WebGL project that I have. If I start the page on Google Chrome and take a heap snapshot on the Profiles tab of Developers Tool, it will say that my page is holding 7.5 MB.

The problem is if I look into Task Manager, the real value that it is using is almost 1 GB! It is expected, since I am really forcing the page to have thousands of objects, but the question is: why Chrome shows to me that I am using only 7.5 MB?

like image 460
Daniel Pereira Avatar asked Nov 10 '12 00:11

Daniel Pereira


1 Answers

update

there was native memory snapshot that was able to show you the native memory graph. Unfortunately we removed it because it was a fragile piece of code. It required nontrivial instrumentation in hundreds of classes and affected the binary size. I hope we reimplement it later.

was

It takes a snapshot of Javascript heap. All your javascript objects use 7.5mb. This size doesn't include images, canvases, audio files, plugin data, etc.

There is a native memory snapshot in DevTools. It counts non-javascript memory used by the renderer process but this is an experimental feature.

You need to enable DevTools experimental feature in chrome://flags, restart the browser, enable Native Memory Profiler experimental feature in DevTools settings panel and reopen DevTools.

After all these steps you will be able to take Native Memory Snapshot in Profiler panel. Not all the memory chunks in the native memory heap are counted but we are working on that.

Please use the Canary version of Chrome. It updates every day and works side-by-side with other versions of Chrome.

If your page eats gigabytes of memory and has big "Other" bar, more than 10%-20%, please drop a mail about that to the Google Chrome Developer Tools Foums.

like image 134
loislo Avatar answered Sep 17 '22 18:09

loislo