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

半腔热情 提交于 2019-12-29 04:34:08

问题


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?


回答1:


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.




回答2:


You can still take snapshots under the profile tab and click take head snapshot which gives you in-depth memory usage stats.



来源:https://stackoverflow.com/questions/13318109/chrome-heap-snapshot-why-it-doesnt-show-all-the-memory-allocated

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!