Browser Support • Re: Why is Pale Moon so slow?
The issue with slowdowns caused by certain sites is because they create a complex document tree that is interlinked with itself. It becomes impossible for the garbage collector to trace and clean up, so it gives up and even if you no longer use the website, it will remain in memory and the garbage collector still tries to clean it up.
A possible solution would be to use jemalloc (preferably the genuine, current one, not Mozilla's old fork) and to create a new memory arena (pool) for each new tab: then direct all allocations made by JS (and by JS only) in that tab to its private arena, and when the tab is closed, you can just trash the whole arena... As long as no shared memory (with other tabs, the browser UI, etc) is involved, there is no risk trashing the whole arena once the scripts using it have been stopped/unloaded, and it saves from using the garbage collector at this point (i.e. after the tab is closed).
Discussion in the ATmosphere