Chrome tab storage is constantly growing, heap size remains unchanged

I am working with a team on a one-page application with a fairly large number of timers and about 10 REST API calls per second. We used Chrome's memory profiling tools to detect all memory leaks - at this point, the heap size remains approximately the same (i.e. between garbage collections).

However, we note that the longer the application runs, the more memory the Chrome tab itself uses. After a few hours, we saw that the tab memory had grown to 350 MB, and the heap size remained at 6 MB. When working overnight, the tab takes up more than 500 MB and becomes inaccessible by morning.

We need the application to work for a long time (we hope to restart it only once a week), so this is a problem.

Here is a screenshot of the heap timeline per hour. As a result, the size of the tab’s closed memory is 350 MB, and the heap size remains at about 5.4 MB.

enter image description here

We saw this in Chrome 40 and Chrome 38 in Windows 7. We have disabled caching, and the application runs in incognito mode.

Any idea why the tab memory will grow to such an extent that Chrome will be unusable while using the JS heap remains so small?

UPDATE: We launched the application for several days, and the tab memory is up to 800 MB, the heap size remains approximately the same.

UPDATE (9/9/15): I'm not sure if this is documented anywhere, but it seems like Chrome is changing the amount of memory that it will allocate for the tab, depending on the amount of free memory in the system, Thus, if you have a lot of free memory, tabs will use a lot of memory, and if you have a little memory, it will not use as much. This doesn't seem to be proportional to the size of the heap, it's probably just what Chrome stores to make itself faster. This is just a theory based on monitoring Chrome memory usage :)

+12
source share
1 answer

This is probably too old and no longer relevant, but for everyone who came across this: probably due to open developer tools. I had an application that would accumulate memory over time, while the heap size remained the same, but when I closed the development tools, the memory dropped a lot and did not recover, as it was when the development tools were opened. When profiling long-term memory, first use the Chrome Task Manager.

I can assume that in your case this is because devtools needs to store all these REST API calls (to show them on the Network tab), and I'm not sure Chrome temporarily saves them to disk to save memory.

0
source

All Articles