How to stop Thunderbird hammering your CPU

My mail client of choice is Thunderbird. It’s always served me well, but recently I’ve noticed that my laptop’s battery life is abysmal when it’s running. A bit of poking reveals that it’s a real CPU hog if you have large mail folders (and I never delete anything!). Finally I found this bug report which has a working solution. It makes Thunderbird 17.0.2 much more gentle on the CPU, and according to the report, should work from version 15 onwards. Perhaps they’ll fix this by default eventually, but for now here’s a quick step-by-step on how to fix the problem yourself.

From the Edit menu, select Preferences (for later versions, select Options from the Tools menu). Click the Advanced tab at the top, then choose Config Editor.

thunderbird-prefs

There will be a dire warning, which you can safely ignore. You’ll then be presented with the configuration editor. Type idle into the search box, and look for mail.db.idle_limit. According to that bug report, the correct value is 30000000. Check the number of zeros you have; if you only have 300000, that could be causing your CPU problems.

thunderbird-config-editor

That’s it! You don’t have to restart Thunderbird to activate the change, and you should see an immediate improvement in its CPU usage. Mine dropped from 60-100% down to <1%.

Why does this work?

According to that bug report, Thunderbird closes its database after five minutes of inactivity (i.e. 300000ms), and re-opening them is very expensive if you have large folders full of crapimportant messages. Perhaps extending the timeout so much introduces a slight risk of corruption if Thunderbird (or your computer) crashes, but it’s a price I’m willing to pay for a nice quiet laptop.

41 Comments

Filed under random

41 Responses to How to stop Thunderbird hammering your CPU

  1. Holy schmokes, I appreciate you writing this up. I’m also seeing TB murder my battery.

    • Okay, here’s a follow-up. Tweaking this setting has a real effect. My system load monitor is visible all the time in my i3bar, so I have a pretty good idea what it should be like under various conditions. My previous idle 1min load index was constantly hovering around 0.9-1.1 (this is a laptop core i5 hyperthreading cpu, so 4,00 == maxed out), with TB spiking CPU every so often and raising load.

      After tweaking this idledb setting, I’m now seeing my idle system 1min load dropping all the way down to 0.4+ range and *staying there* until I actually do something. This is an amazing improvement.

  2. frisbee

    Changed the settings with two additional zero’s. No improvement however. TB keeps using 10% CPU while idle.
    Apple Mail uses 0.1% CPU while idle. Both mailboxes contain almost equal amounts of mail.
    I very much wish to keep TB. So what to do now?

  3. Mike

    Unbelievable. This simple change has my CPU running about 25C cooler. Many thanks.

    • flup

      You’re welcome :) It seems to work for some people and not others, so presumably more than one thing can make Thunderbird run hot. I’m starting to lean away from it to be honest: there doesn’t seem to be much development effort in its direction, and it has become awfully bloated and awkward.

  4. Travis

    Clearly, there is something else going on with my Thunderbird. No luck with this fix. And I was so hopeful.

    I looked, and sure enough, the setting was wrong. I changed it, but no joy. The CPU and memory are both going crazy and have been since I copied a large section of an IMAP folder (I was running out of space on the IMAP server) to a local folder.

    I thought that it just needed time to compact the folder, or re-index etc… but it’s been days. I left it over night and it’s the same this morning. I am glad I have 4 cores on my machine, but it’s taking up an entire one (25% CPU), and I can barely do anything at all in thunderbird, it’s essentially frozen.

    For a while, I noticed it went to 26-27% CPU, and the at least then, it was usable (I imagine it was using 1 CPU for thrashing, and another one for doing the usual interactions – but I don’t know – there wasn’t an extra process running that I could see).

    Also, the memory goes quickly from a low of about 120M, through a few cycles, 150, 200, 250, 300M and then quickly back to 120M… again, for DAYS.

    It seems to settle after a while, some minutes or hours, but as soon as I touch it again, it’s back into its cycle. I’ve been forced to go through the email web interface, which isn’t the best.

  5. R

    Hello,
    it seems good and I would like to try, but, searching into my about:config for ‘idle’, I have not this ‘mail.db.idle_limit’ parameter… It’s just absent. What does it mean? Is that a problem? Should I create it? I haven’t found anything about this so far. Thanks for any help.

  6. Pingback: Thunderbird CPU-Killer! Was tun? | kaeotic.com

  7. On Ubuntu (12.10) the fix will work but you have to restart thunderbird

  8. plotino

    Same problem here, the setting was wrong and fixing it now my CPU fro TB is <1% (was 25%, i.e. one core at 100%). I had to restart TB though to make it effective. Using SUSE 12.3. Can't wait to see if my battery life will benefit (have long meeting this afternoon….)

  9. ramon

    On Ubuntu 13.04 the fix also works, but just as stas z wrote you have to restart thunderbird. Thanks for the fix!

  10. This is AMAZING! Thanks so much for the fix. I made the change and immediately my CPU usage from Thunderbird dropped from 10-20% to .22%. I’m running the latest Thunderbird release (24.0) on Windows 7.

  11. Denton the bear

    While I was not having an issue with Thunderbird in respect to CPU usage I look at the setting anyway. Mine was set 300000 so I changed it, CPU usage has dropped from 3/4% to 1/1.5%. It all helps.

  12. If you had a BTC/LTC address I’d give you a tip. Thank you for posting this!

  13. mindgrep

    This is a life saver!! Thunderbird was making my system slow to a crawl. I did have to restart thunderbird to see the effect. I am running Thunderbird 17.0 on Ubuntu 11.10.

  14. metacor

    Amazing.

    CPU usage dropped from 25% to less than 1%. (Kubuntu 13)

    Thx!

  15. gtr

    Hi there,

    thanks for the tip, worked pretty well with thunderbird 24.1.0,

  16. Jim

    Thanks, great tip. I’m new to Thunderbird and this change made the CPU usage drop from 29% to 0.3% (of one hardware thread) on my MSI CX61 laptop.

    Pretty unbelievable error. Think I prefer Kmail -> just looks prettier, seems lighter.

  17. BA

    This is a pretty awesome fix! Like Jim, I prefer Kmail, but there is something wonky about how it munges emails when you sign or encrypt and sign, causing it to fail signature checks.

    So for managing encrypted messages, I have had to go with thunderbird, and this fix makes it usable.

  18. rtt

    Unfortunately this didn’t help, I think Thunderbird just can’t handle dozens of mailboxes with several hundred thousand e-mails under IMAP unfortunately (tried all the possible fixes and different versions). It’s weird how a webmail client can be more efficient without lag in this sense.

  19. Savek

    Thank you for posting this! CPU usage dropped from a constant 8-10% when idle to hardly anything (TB 24 on OpenSuSE 12.3, had to restart TB)

  20. This solution worked exactly as mentioned in the post and by others above. I had to restart my system though before I saw the change as restarting thunderbird did not work for me. I’m on Fedora 20 and have a less than ordinary dual core system that is 6 yrs old and my cpu usage dropped from 25 – 30% to less than 1%. Thanks for the fix.

  21. tsuchan

    Thanks… I think your article could make a very real effect on the global carbon footprint!

  22. I tried this solution but didn’t make any change.
    I then disabled the Global Search and Indexer and I went down from 50% to 1% CPU usage on my laptop!

    For those who are still fighting Thunderbird’s hogging, give it a try:
    Preferences->Advanced->General->Enable Global Search and Indexer

  23. Pingback: Linux para principiantes | malv2012

  24. Greetings! I love smart people that take the time to share there knowledge and tips with the world.

  25. Moleman

    I just tried this- we’ll see what happens…. But you know? I am so sick of these gigantic, bloated complex programs for doing a simple task like reading emails. Think I’m just going to switch to the simple, minimalistic MUTT. I gave up Windurs and switched to Linux years ago…why should I continue to use bloated programs which seem to be based on the same disfunctionality which gave us Windurs?

    • flup

      It was ever thus. Simple thing is written, features get added, thing gets bloated, someone writes a simpler thing, lather, rinse, repeat.

  26. I found this as I was looking into why Thunderbird was such a resource hog.

    I thought to give it a try and it worked for me for this also.

    I also set chat to Keep my Chat Accounts Offline ( seriously who would bother using TB for chat anyway? )

    …and now it’s using a miniscule amount of resources… thanks for sharing this!

  27. Whoop! And so my little netbook’s battery time went from 2.5 hours to 4 hours, just with this little tweak! Thanks so much!

  28. Al

    Thanks! I tried this on my desktop computer, which was slowing down so much I was having to physically reboot it. Problem solved! (Using Ubuntu 14.04 with TB 24.6.0).

    Can’t believe they still haven’t fixed the problem.

  29. Isidro

    Thank you!!! It help me a lot. Not only my laptop battery as well my desktop cpu usage dropped from 60-70% to 1-2%

  30. Woo hoo! Thank you so much. Thunderbird suddenly started getting slow and taking up CPU time. I upgraded to the latest and greatest and still had the issue. This fixed it instantly. Can’t thank you enough.

  31. Carter Brey

    Thanks so much for this simple fix. I run TB on Linux Mint 16 and was starting to think about switching clients. Life is good again.

Leave a Reply