Browser update does not do garbage collection

I found this in all tested browsers - IE, Firefox, Chrome and Safari on Windows Sand Safari on Apple.

Presumably, a browser update, return button or direct link should reset browser nodes, variables and javascript objects, etc. This does not seem to apply to WebGL. I first noticed this when developing a complex WebGL application that requires 100 to 200 MB of memory. During development, I needed a lot of updates, and my computer started to slow down and freeze after 5-10 updates.

After some research, I realized that this should not be. The decision made due to a memory leak is to refresh the page, which should free up all javascript objects, variables and dom nodes. But take a look at the following images:

So what's the deal here? This is not seen in small applications, but for large WebGL applications such as mine (orbitingeden.com), this is a real problem, and my users will think that the software is even more resources than it actually is. The following figure shows how these updates consume all available memory, so garbage collection does not work and / or JS and DOM objects are not freed:

enter image description here
(source: orbitingeden.com )

Does anyone know a trick that forces the browser to do a real memory dump? Why is all the documentation there wrong?

+9
javascript dom memory-leaks webgl page-refresh
source share
1 answer

One of the items with garbage collection is that objects are not cleaned immediately, they become unused. The garbage collector can determine for himself when it is most convenient to make collections.

This is normal for a garbage collector. tp leaves some unused objects on the heap if there is a lot of memory to use. The computer does not work faster due to the large amount of unused memory.

+2
source share

All Articles