Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
443 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...