Justin du Coeur (jducoeur) wrote,
Justin du Coeur
jducoeur

[PROGRAMMING] It's all a matter of knowing the right incantation...

There -- that seems to have worked.

For the past couple of months, one thing has been particularly annoying me about my new laptop. When I close the lid, it goes into Standby mode, as it should. Sometimes, when I open the lid, it instantly restarts, as it should. But sometimes it doesn't -- sometimes it takes a long time, even a couple of minutes, to wake up.

I finally twigged that the relevant factor was whether Firefox was running or not. And I remembered, in the back of my head, that I've read about Firefox' extreme swap behaviour before. Apparently, if you let Firefox sit minimized for a relatively long time (more than half an hour or so), it gives up nearly all of its memory to the OS, by aggressively trimming its active set. When it comes back to life, it needs to rebuild all of its state, and this can take a pretty long time -- especially if, like me, you have half a dozen tabs open at any given time. Usually this problem only shows up when you reopen Firefox from minimized, but it apparently also applies in my laptop-restart case.

Anyway, after a bunch of Googling around, I finally found the recipe for dealing with this. There's a hidden preference in Firefox, "config.trim_on_minimize", that deals with this. If you create this preference in about:config, and set it to false, the problem goes away. It means that Firefox is hogging system memory, but I don't care: I usually only have a couple of programs running on the laptop anyway.

It is one of those moments that makes me feel like a sort of proto-TechnoMage, though. You can bend your environment to your will, but only if you know the right sigils and signs, which are closely-guarded secrets of the hidden masters...
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 3 comments