Task manager shows memory leak but heap snapshot is not

I run heavy JavaScript every 5 seconds, and the task manager shows a steady increase in memory usage. However, the Heap snapshot does not. If I stop the script, the memory will be deleted after half a minute two minutes later.

UPDATE:

If I leave the script for a long time, the memory will increase until the browser crashes. I also tried checking the timeline of the chrome dev tools, and they also show no increase in memory usage, like a heap snapshot. Therefore, I assume that this is some kind of leak, but I can not understand what is happening.

Another thing that I can’t confirm, since I can’t install previous versions of Chrome, I don’t remember how it happened in previous versions (<24 Chrome). And IE10 runs this test without increasing the amount of memory. Could this be a problem with the new Chrome?

+3
source share
1 answer

Assuming you are linking to the Chrome developer tools, you might not see the memory increase in the Heap snapshot because the Heap Snapshot profiler starts the garbage collector before the snapshot.

Monitoring increased memory usage, especially during active processing, is normal. The garbage collector does not work unnecessarily. If your computer has spare memory, this will allow you to reserve memory. If you start pushing the free memory limit, the collector should work. You must allow this to make sure it is.

Since you are reporting that the memory is reverting to the initial level after a timeout period, this indicates that there is no memory leak, and the garbage collector may correctly collect all allocated heap objects.

However, IANAGE (I'm not a Google engineer). I recommend reading the Heap Bus Documentation and the associated memory page 101 for the background.

+3
source

All Articles