Hacker News new | ask | show | jobs
by sedev 5459 days ago
While the improvements they're promising are certainly a Good Thing, one bit jumps out at me:

"introduced a significantly improved about:memory page with buttons that can manually trigger garbage collection (GC) and cycle collection (CC)... hitting these buttons repeatedly — or by hitting “Minimize memory usage”, which triggers both processes three times in a row — you can reduce Firefox 6′s memory footprint significantly."

Really? Really, guys? That is a wincingly strong code smell. Why is it necessary to press the button more than once? Why is it necessary to press the button at all? I appreciate that it's hard to get all of this working correctly, but that's a clunker of a design - it tells me that this feature does not actually work, but instead kinda-sorta-maybe works. Something like that should, pardon the cliché, Just Work - it is way out of the scope of things you should have to care about while browsing.

2 comments

If you had read the bug report and the discussion below it, you'd know that chunks of virtual memory (VM) are not freed to the OS immediately after they are empty, but are only freed after 3 GCs. That's actually an optimization; allocating VM is expensive, and doing it just after you've freed some is plain stupid.

The problem with GCs is not that they don't actually work, it's that they are suited to a specific task. If the user is surfing the web and constantly opening/reloading pages, then GC will be ok. However, if you close most of your tabs and only leave a few open, then you might have to tell the computer that you won't be needing more memory soon and that it's welcome to free as much VM as possible. That's what those buttons are for.

Thank you for that clarification. That has improved my understanding of the situation.
After 20 seconds the browser perform this "idle-cleanup" for you and there is no need to press this button all the time if you want to minimize memory usage.
I think these buttons are intended for debugging. Normal users don't hang around about:memory. (This area isn't exposed in the UI anywhere.)