Ubuntu

Thunderbird stuck at 100% CPU

Reported by Dennis van Dok on 2012-02-06
260
This bug affects 61 people
Affects Status Importance Assigned to Milestone
Mozilla Thunderbird
New
High
The Ubuntu Power Consumption Project
Undecided
Unassigned
thunderbird (Ubuntu)
High
Unassigned

Bug Description

Just received the automatic update last night. Ever since, thunderbird is using 20-50% CPU constantly, according to top.
Turned off global search and indexing to no avail.

This is really bad for me as it's driving up the temperature of my laptop, runs up the fan noise and reduces battery time.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: thunderbird 10.0+build1-0ubuntu0.11.10.1
ProcVersionSignature: Ubuntu 3.0.0-16.28-generic 3.0.17
Uname: Linux 3.0.0-16-generic x86_64
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
BuildID: 20120129183038
Date: Mon Feb 6 10:44:55 2012
EcryptfsInUse: Yes
ProcEnviron:
 LANGUAGE=nl_NL:nl:en
 PATH=(custom, user)
 LANG=nl_NL.UTF-8
 SHELL=/bin/bash
Profile0Extensions: extensions.sqlite corrupt or missing
Profile0Locales: extensions.sqlite corrupt or missing
Profile0Plugins: pluginreg.dat isn't available
Profile0Themes: extensions.sqlite corrupt or missing
Profiles:
 Profile0 - LastVersion=3.0.6/20100713193322 (Out of date)
 Profile1 (Default) - LastVersion=10.0/20120129183038 (Running)
SourcePackage: thunderbird
UpgradeStatus: Upgraded to oneiric on 2012-02-02 (4 days ago)

Dennis van Dok (dvandok-gmail) wrote :
Dennis van Dok (dvandok-gmail) wrote :

H'm, this may have been a transient issue. Just restarted again and all seems quiet now...

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in thunderbird (Ubuntu):
status: New → Confirmed
David Henningsson (diwic) wrote :

I can confirm this. It just does it occasionally, so it's not really reproducible. I had the issue a few days ago, then it settled down, and now it's back again.

tags: added: regression-update
Carl Unsworth (carlunsworthuk) wrote :

I am seeing 22-25% CPU usage by Thunderbird. When TB is open, compiz is also using around 20%, this drops to around 1% when TB is closed.

I have the same issue with Ubuntu 12.04 LTS 64 bit on a MacBook Pro 8,1 (late 2011). Whenever I have Thunderbird open, my CPU usage shoots up to about 20%, my laptop heats up and my battery gets drained atleast twice or even thrice as quickly. Makes Thunderbird unusable on my laptop.

David Henningsson (diwic) wrote :

To me, it seems related to fetching new messages. I have a lot of messages in my mailbox, and in many different folders. When doing the initial sync for a new setup, it is very CPU intensive.

Michael Nagel (nailor) wrote :

I possibly have this issue as well. however, after letting thunderbird run for 18 hours (!) of cpu time the cpu usage dropped to reasonable levels. after exiting and restarting thunderbird the usage goes up again for some minutes but then normalizes much faster...

I only see this when working online. If I change to working offline, the CPU usage drops to idle. I f I re-enable working online, the CPU spikes again.

It appears to be related to loading/indexing mail from remote IMAP mailserver that contains a lot of mail on a new install that hasn't previously connected to the mailserver.

Changed in thunderbird (Ubuntu):
importance: Undecided → High
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
Sebastien Bacher (seb128) wrote :

Thanks Brian, thanks to those who commented on that bug so far, it seems that due to the "regression-update" tag those comments are reaching the SRU team so I'm dropping that and unassigning the desktop team on those basis:

- the bug was reported on tb10, we are at tb13 so it's not a recent regression
- the number of users affected and report are low
- it's difficult to debug since none of the tb hackers around get the issue
- the recent comments suggest it might not even be a bug, indexing on big boxes take cpu, if you don't want that you can disable the indexing

Changed in thunderbird (Ubuntu):
assignee: Canonical Desktop Team (canonical-desktop-team) → nobody
tags: removed: regression-update

Some further info: My syslog was geting spammed with eCryptfs messages as per https://bugs.launchpad.net/ecryptfs/+bug/911507, but only when Thunderbird was in online mode.

The culprit was a zero length global-messages-db.sqlite-journal file under .thunderbird. I'd copied my .thunderbird directory from my old laptop (that wasn't using encrypted homedir) to the new laptop (which is using encrypted homedir).

Moving the file out of the way stopped the eCryptfs spam, and dropped CPU usage from about 70%+ to about 54%, which isn't melting the laptop.

Thunderbird has recreated the global-messages-db.sqlite-journal file, and it now has non-zero length. I guess what it's doing now is more normal.

David Henningsson (diwic) wrote :

Regression or not, it's still an annoying bug.

I'm attaching performance data from my older computer, where this is a nuisance. In the two minutes I let Thunderbird run, it fetched less than 1000 emails - which means just a few emails per second (which is not good IMO!).

The latest comment indicates that this would be eCryptfs related - for the record, I'm also running eCryptfs. Seeing the top perf results, it looks like they are crypto related, but I don't think this is the only cause. The fact that it also seems to spend a significant amount of time in pthread_mutex_lock/unlock also looks like a programming error to me.

 14,78% thunderbird-bin [kernel.kallsyms] [k] aes_encrypt
  3,65% thunderbird-bin libfreebl3.so [.] rijndael_decryptBlock128
  3,56% thunderbird-bin libmozsqlite3.so [.] zeroPage
  3,50% thunderbird-bin [kernel.kallsyms] [k] aes_decrypt
  2,56% thunderbird-bin libpthread-2.15.so [.] pthread_mutex_lock
  1,84% thunderbird-bin libpthread-2.15.so [.] __pthread_mutex_unlock_usercnt
  1,80% thunderbird-bin [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore
  1,75% thunderbird-bin [kernel.kallsyms] [k] __copy_from_user_ll_nozero
  1,71% thunderbird-bin libfreebl3.so [.] shaCompress

David Henningsson (diwic) wrote :

The strace log is a bit long to attach here, but under one minute of fetching emails, it
 - calls gettimeofday about 200 000 times
 - trying to open different files in /usr/share/mime, 20 000 times
 - trying to open gedit.desktop in different directories, 1300 times

...is this really correct behaviour?

Created attachment 646142
Excessive Thunderbird.png

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1
Build ID: 20120614114901

Steps to reproduce:

Selected multiple emails (about 30) and tried to move them to another folder. This is completely repeatable.

Actual results:

cpu went up to 98-99% for several minutes, timer showing, nothing obviously happening

Expected results:

selected emails should have moved to other folder

no messages moved?
is this imap folder to imap folder? how big is the target folder?

Thunderbird 14 worked?
Does safe mode work? http://support.mozillamessaging.com/en-US/kb/safe-mode

Yes it is imap to imap, but actually that doesn't seem to matter, the problem occurs before the move is initiated. I now have a slightly different ways of recreating it, and perhaps more useful.

Select multiple emails over more than one page so that there is a need to scroll.
wait until all emails are shown selected.
click on scroll bar to move to another view of the selected documents.
the system goes hyper!

Another is to click on the delete button instead of trying to move the scroll bar.

Bottom line is that operations (not apparently all operations) that involve multiple selections can kick off some very intensive cpu activity that can go on for several minutes. It doesn't happen every time, but does seem to have something to do with the status of the folder in which the emails are being selected - so maybe something like re-indexing the whole folder, or compressing it on the fly, or something like that. However there is no apparent disk activity, it's pure cpu although the memory footprint does change up and down a bit.

Hope this helps.

In response to your last two questions. I did not notice this problem in 14.
I did have a problem in 14 where emails were not always properly displayed when a new email was selected and it took forever to recover - that seems related, but actually that problem has gone away.

I have not tried safe mode.

Can you see if this is bug 750781 or bug 777221?

Markus W (z-mw) wrote :

Had the exact same issue as comment #11 including log spamming and can confirm that deleting the empty file 'global-messages-db.sqlite-journal' in my Thunderbird account folder resolved the issue.

This was under Ubuntu 12.04 with Thunderbird 14 and encrypted home directory.

Are these emails with attachments ?

Yup, but I don't think this is the same problem as 782899 because there is no memory hogging, just huge cpu hogging.

Martin

Is there any more data I could gather that would help resolve this one?

Martin

I was also having this issue with Ubuntu 12.04 and encrypted home directory. I removed the encryption for other reasons, and now thunderbird is not pegging CPU.

Thomas T. (dontpanic) wrote :

I was having this issue aswell with Ubuntu 12.04 and Thunderbird 15.0.1. The solution described in comment #14 works for me.

Tobias Grosser (0d4wr2xj9) wrote :

I just tried thunderbird 16.0.1. I get the similar numbers as David:

> - calls gettimeofday about 200 000 times

I do not see this.

> - trying to open different files in /usr/share/mime, 20 000 times
> - trying to open gedit.desktop in different directories, 1300 times

Those show up. I do not have a file global-messages-db.sqlite-journal. So solution #14 does not apply.

nh2 (nh2) wrote :

I have the same problem on 12.04 with Thunderbird 16.0.1.

After starting, CPU spikes up to ~60% and stays there for around 20 minutes.

Switching to offline mode immediately stops the problem, switching it back on resumes it, so yes, it is probably email syncing or something related.

There is a good amount of emails in my TB (around 10k unread, and probably 50k read) and my .thunderbird folder is around 3GB of size, but I don't think this justifies what happens - probably it is a bug.

I have attached my strace log (no gettimeofday calls btw); watch out, it blows up to 70MB when uncompressed.

This problem is highly annoying and drains my CPU quickly.

Do we have an upstream bug for this?

Nokya (nokya) wrote :

Also witnessing the problem. I guess so few people noticed it is that it might be somehow associated to users who have several email accounts configured (I have 11 accounts configured in my TB profile).

Opening the activity window shows that a lot (and probably too many) of sync operations are being performed at the same time. Is there a setting that defines the number of synchronizations that TB can perform simultaneously?

I suspect it to be the main reason why my laptop battery gets drained in less than 2:00...whereas on Windows (also with TB running) the battery can handle 4:00 easily.

system: 12.10x64
ram: 8g
cpu: i7 640M (4x2.8ghz.)

jds (jay-schieber) wrote :

I am having the same problem. Thunderbird pegs one processor at near 100%. The instructions in comment #11 did not fix it. Activity Manager sometimes shows no activity for several minutes, but the CPU use is still high. Probably more important is that it just keeps cycling between syncing Sent Mail and All Mail with my gmail account. My other active account is much more quiet.

Daniel van Vugt (vanvugt) wrote :

Confirmed on quantal. At the tame time, thunderbird is triggering constant redraws as seen in the Compiz Benchmark plugin. Killing and restarting thunderbird fixed it for me.

summary: - thunderbird uses excessive cpu power
+ Thunderbird stuck at 100% CPU
Eric Mauricio (ericmaubr) wrote :

I am having the same issue with Windows 7. I guess it is not only related to Ubuntu or Linux.
I tried to disable Global Search, remove .msf, rebuild index, compact folders and remove global-messages-db.sqllite.
None of these steps make CPU lower.

I am running TB 17.0.2.

[ ],
  Eric

I didn't have the global-messages-db.sqlite-journal file; I did have global-messages-db.sqlite having ~400 MB.

After removing global-messages-db.sqlite and starting Thunderbird, it created new global-messages-db.sqlite and global-messages-db.sqlite-journal files.

Thunderbird CPU usage didn't go down; it's still constantly 50%-100% CPU usage.

David (skull-12) wrote :

I can confirm this with thunderbird 17.0.2 on a 12.10 Kubuntu Version.

The problem was resolved with deactivating the message synchronisation of an IMAP mail account.
My other accounts using POP-Servers don't generate the high CPU usage.

Removin
messages-db.sqlite and global-messages-db.sqlite-journal files.
before has not changed anything.

David (davidm2005) wrote :

Also have this problem: on Xubuntu 12.04 with thunderbird version 17.0.3+build1-0ubuntu0.12.04.1

Removed all addons, tried removing all sqlite databased, still 100% usage.

I am also experiencing this bug with TB 17.0 on Linux Mint Debian Edition with an XFCE 4.8 desktop.

What I have found is that CPU usage tends towards 100% on one core when displaying the contents of a message in the Message Pane (use F8 to switch view). When the Message Pane is empty or not visible it does not happen.

The behaviour happens both with IMAP and POP3 accounts and both with text and HTML messages.
There is no evidence whatsoever that earlier suggested indexing or encryption mechanisms have anything to do with it.

Workaround: Do not use the Message Pane. Use F8 to switch it off.

I have also reported these findings in the upstream bug report:
https://bugzilla.mozilla.org/show_bug.cgi?id=794401

Andrew Frank (frank-geoinfo) wrote :

i experience the same probelms - very annoying on an old computer with little cpu power. i use
Release 12.04 (precise) 32-bit
Kernel Linux 3.2.0-39-generic-pae
GNOME 3.4.2

the high cpu is regularly after starting tb and goes on for quite a while (15 minutes +), it seems related to IMAP synchronization in a quite large mail account.
closing teh message pane did not reduce the cpu load.

please fix!
thank you - andrew

vanadium (ftack) wrote :

Just browsing, I noticed that my ventilator was heavily working. "top" revealed that it was Thunderbird that was spiking the cpu, even though it had just been open in the background for a long time. My computer was up for 3 hours 15 minutes at that time. Indeed, the output of top below, sorted by TIME+, indeed demonstrates that thunderbird needed s=tremendous more processor time than other applications

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 7206 vanad 20 0 1402m 282m 41m S 0.0 3.6 57:24.71 thunderbird
 1179 root 20 0 137m 25m 5700 S 6.7 0.3 7:06.94 Xorg
 3008 vanad 20 0 1471m 148m 34m S 1.7 1.9 2:04.82 compiz
30869 vanad 20 0 1158m 293m 40m S 7.3 3.7 1:22.67 firefox
 2881 vanad 20 0 485m 27m 19m S 10.3 0.4 1:07.88 gnome-system-mo
 1348 root 35 15 24132 8420 1008 S 0.0 0.1 0:52.04 preload
 3024 vanad 20 0 923m 49m 19m S 0.0 0.6 0:27.90 nautilus
 8687 vanad 20 0 1456m 165m 82m S 0.0 2.1 0:19.61 soffice.bin
 7621 vanad 20 0 744m 24m 12m S 0.0 0.3 0:09.45 gnome-search-to
 5977 vanad 20 0 1321m 124m 15m S 0.0 1.6 0:07.44 evince
 4466 vanad 20 0 420m 19m 4440 S 0.0 0.3 0:07.23 zeitgeist-datah
17066 vanad 20 0 726m 71m 15m S 0.0 0.9 0:07.01 evince

Poru (poru) wrote :

I have also been experiencing thunderbird sometimes consuming 100% cpu. In my case I have a suspicion that it may be related to what appears to be a bug in ibus that I have reported here: https://bugs.launchpad.net/ubuntu/+source/ibus/+bug/1162008

Ken Johnson (prak4242) wrote :

I can confirm the same behavior on Ubuntu 12.10, with encrypted home directory, running Thunderbird 17.05. Thunderbird constantly using 50-100% cpu, for hours at a time, only occasionally dropping below 50%. Creating new profiles, deleting various sqlite files, index files, etc does not fix the problem.

However - since others have ointed out that this seems to be eCryptFS related - I can confirm that moving my thunderbird profile to an unencrypted directory outside of my home directory seems to "solve" or at least greatly reduce the severity of the problem.

If you are able to (given the security implications), I would recommend others to try this workaround.

My suspicion is that there is some serious performance bug in
Thunderbirds IMAP / IMAP IDLE implementation once then number of emails
gets big.

We should find out if it happens with TB on Windows / Mac as well.

My IMAP folder, albeit large, is *NOT* encrypted and I do suffer from the same problem as long as the Message Pane (message preview) is open. Switching it off with F8 calms Thunderbird 17.0 down to almost negligible CPU usage levels.

icylucifer (icylucifer) wrote :

I'm also seeing this.

Thunderbird 17.01
64-bit Linux Mint Debian Edition (using MATE)

I have some pretty massive IMAP folders, but no encryption.

Thank you for pointing out the message pane workaround; it's awkward, but it'll do until this gets fixed or I find an alternative mail client.

Tuomas (tuma+sec) wrote :

I do have this issue even if message pane is closed with F8 and also no other message windows or tabs are opened.
Thunderbird 17.0.5, Ubuntu 13.04.

papukaija (papukaija) on 2013-05-11
tags: added: i386 quantal raring
removed: oneiric

Since this bug:

- Is valid.
- Is well described.
- Is ready to be worked on by a developer.

I'm reporting it upstream.

Changed in thunderbird (Ubuntu):
assignee: nobody → Alberto Salvia Novella (es20490446e)
Changed in ubuntu-power-consumption:
status: New → Confirmed

Since this bug:

- Is valid.
- Is well described.
- Is reported in the upstream project.
- Is ready to be worked on by a developer.

It's already triaged.

Changed in thunderbird (Ubuntu):
status: Confirmed → Triaged
Changed in thunderbird:
importance: Unknown → High
status: Unknown → New
Changed in thunderbird (Ubuntu):
assignee: Alberto Salvia Novella (es20490446e) → nobody

Any relation to bug 778907 or bug 812923 ?

Poru (poru) wrote :

From the comments above it looks like there could be several distinct causes of Thunderbird running at 100%.

In my case, I have just upgraded to Raring and the situation has got worse. It now happens pretty much every time I try to minimise or close Thunderbird. Thunderbird will just sit there for hours running at 100%. For me it's worse than that because I use ibus to switch languages and it causes ibus to refresh itself continuously too (see bug #1162008), thus making the computer practically unusable. My key observations are that:

- Now I have upgraded to Raring, this 100% cpu usage is (sometimes) happening when I minimise Nautilus or Firefox too. When this happens, compiz is also near the top of top.
- I have tried using the default xorg graphics drivers and the proprietary nvidia ones, and the issue is the same.
- My colleagues that have similar setups to me (same graphics card, 64bit, similar processors) don't have the same problem. However, I am the only one that has an encrypted home directory.

So, to me this implies that the root cause is some incompatibility between an encrypted home and compiz/Unity, which Thunderbird also happens to be a victim of too. It may just be that Thunderbird tries to write more configuration/database stuff to the (encrypted) home directory when it is minimised than Nautilus or Firefox and so it's a lot more noticeable for Thunderbird than for the others.

Per Baekgaard (baekgaard) wrote :

For someone looking for a workaround, then the 100% CPU usage could apparently also be a result of TB reopening/reindexing databases too often. According to these links:

   https://bugzilla.mozilla.org/show_bug.cgi?id=794401
   http://rainbow.chard.org/2013/02/19/thunderbird-high-cpu/

it appears that "Technically ... [Thunderbird] check open DBs every minute, and if they have been open more than 3 seconds and there are no other references to them, they are closed. The '3 seconds' has now been changed to the original intent of 5 minutes."

On my system, mail.db_idle.limit was set to 300000, which might have been the intended value... But I've increased it to 30000000 as others have suggested, which seems to help -- I have many really really large IMAP folders, so indexing is a slow process that can last minutes.

Whether it has negative impacts elsewhere remains to be seen. But it is an easy tweak and fast to test

Tuomas (tuma+sec) wrote :

Per Baekgaard, I tested your workaround suggestion, but it does not seem to help in my case.

Fabio M. Panico (fbugnon) wrote :

I also experience a high CPU usage (generally around 70%, measured by top), with:

- Thunderbir 17.0.7
- Ubuntu 13.04 32bit
on a ThinkPad T60 with Intel T2400 @ 1.83GHz × 2

I have several e-mail accounts on TB (total of 5, being 3 imap gmail/yahoo and 2 private imap/pop).

I don't know if this is related to this bug.

BUT I've notice something very simple that sort of "solves" the issue for me, apparently having to do to what is selected in the lateral folder pane:

1. IF I leave the INBOX of any account selected (or actually any other FOLDER), even though activity manager could show no recent activity for, say, the last 10 minutes, I see a turning wheel on TB's e-mail tab and I notice TB takes about 70% of CPU (measured by top). See attached screenshot.

2. On the other hand, IF I select no INBOX/FOLDER but simply click on one account (lateral pane - see attached screenshot), TB CPU usage drops to <2%, coming up eventually to 20-30% of CPU for a few seconds, every 40 seconds or so, I believe when checking for new messages.

I'm only a user with no technical knowledge, but IMHO, it seems that TB actually keeps constantly updating the messages/account if and INBOX/internal FOLDER is selected, even when no activity is registered by "activity manager". Could it be?

Fabio M. Panico (fbugnon) wrote :
Fabio M. Panico (fbugnon) wrote :
Alexander List (alexlist) wrote :

Hi,

http://rainbow.chard.org/2013/02/19/thunderbird-high-cpu/ worked for me, dropping CPU usage to almost none.

I noticed that the problem surfaces after extend time (several days) of being offline and re-syncing remote IMAP folders on multiple accounts in parallel.

TB was at 100% CPU, causing the CPU fan to spin up to max, and unfortunately even on my TP x201 these fans are not built for running at max rpm all the time, so it died upon me and I had to replace the heatsink assembly ... this was of course an unlucky combination of this bug, dust in the heatsink, running at max RPM, and a kernel bug that messed up fan control, so TB alone was not the one killing my fan ;)

Edmo (edmo) wrote :

Hello,
I am using ubuntu 12.04 LTE and Thunderbird 24.0.
Probably due to some automatic ubuntu update; now, when I start Thunderbird it, freezes after a few seconds and the CPU goes > 100%..
After reading the other comments I made a copy of the ImapMail folder in .thunderbird/*.default and then deleted it.
The problem dissapeared.
Hopes this helps,
Ed

Edmo (edmo) wrote :

Hello again,
Then I tried the original ImapMail folder but removed all the .msf files. This also worked.
Best,
Ed

Alexander List (alexlist) wrote :

I have 2 IMAP accounts configured, and noticed that the CPU hogging / hanging is definitely related to the number of messages in a mailbox. I haven't found a lower bound that causes the issue, but mailboxes with e.g. 20000 or more messages of cronspam were definitely part of the problem. Removing these messages and/or partitioning them e.g. chronologically may be a viable workaround.

Testing with "insanely large" mailboxes should definitely be part of finding the problem ;)

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.