Open Bug 367431 Opened 18 years ago Updated 1 month ago

New Mail alert/notification popup takes 100% CPU for 10 secs during fade in/out with KDE. XUL-based notification

Categories

(Thunderbird :: Mail Window Front End, defect)

x86
Linux
defect

Tracking

(Not tracked)

People

(Reporter: BenB, Unassigned, NeedInfo)

References

(Depends on 1 open bug)

Details

(Keywords: perf, stackwanted, Whiteboard: [needs profile])

On trunk, I see a relatively big popup displaying the subjects of my new mails appearing in the lower right corner of my desktop (not mail window).

It fades in and out and the background goes transparent for a moment. I don't think the latter is intended. The fading is very slow, takes 10 (or more) seconds, is jerky, and I have 100% CPU usage during that time. (The CPU usage may be partially due to the spam filter / move operation - I get a lot of spam.)

This is on Linux (SuSE 10.1), with a build from Mo Jan 15 18:51:32 CET 2007.

It's really not ready for prime-time as-is.
It appeared again (mail fetch every 10 mins), and I counted:

27 seconds total, 100% CPU during that time.
6 seconds simply a grey background, no text.
6 seconds to fade in (faint yellow background)
2 seconds transparent
Rest opaque or fade out
could this be a trunk only problem maybe with the new graphics stuff?
This definitely is on trunk, I haven't seen it on the branch. But I don't remember ever seeing the popup before, so I don't know if it's the feature of "the new graphics stuff".
> I haven't seen it on the branch.

Correction: I ran with an older branch build. I do see it on the branch now, but not quite as bad. It also uses 100% CPU, but is faster, not jerky, and has no transparency bug. The 100% CPU still makes it a bug.
Is this with the default theme?  (FWIW, haven't seen it, testing mostly branch builds)
Yes
is "play a sound" for new messages turned on, or off?  if on, does condition improve if sound turned off?
Bug appears with sound turned off (now version 2.0.0.5pre (20070617) and SuSE 10.2).
Note that with 2.0.0.5pre, the situation is not as obviously broken as described in comment 1, but still shows the original bug: The fade in/out is very slow (no point) and still eats 100% CPU.
I suggest to get rid of the fading or to dramatically optimize it.
are you able to reproduce?
can it be reproduced on windows?

bug 420254 is not directly relevant, but are there any ideas there that may help with this bug?
Keywords: perf
I tried to reproduce it with TB3.0a1pre (20080319) on Windows Vista 64bit and also on Ubuntu. I am not able to reproduce it.
with all the linux heavies here not able to reproduce, it seems unlikely to be a widespread problem.

Assuming first this still happens for Ben on current trunk, is it possible for Ben to profile this?

Ben, the problem persists if "show an alert" is turned off?
Assignee: mscott → nobody
Severity: major → minor
Summary: New Mail popup takes 100% CPU for 10 secs → New Mail alert popup takes 100% CPU for 10 secs
it is really slow for me too and basically hangs thunderbird for several seconds, oddly enough not quite equally slow each time nor do I think it correlates with the size of the popup ...or I could just be imagining stuff wrt the differences
> the problem persists if "show an alert" is turned off?

Obviously not.
(In reply to comment #15)
> > the problem persists if "show an alert" is turned off?
> 
> Obviously not.

just checking, since it wasn't stated.


How is it affected if items checked in "customize mail alert" options are changed?

Wayne, the problem is clearly the method of graphics drawing on Linux, not the contents. Please try to reproduce the bug yourself before asking me further questions.
Severity: minor → major
i wasn't asking you
Maybe you were asking me (since you added me as CC), but I'm not using Thunderbird anymore. However, on SeaMonkey (trunk) I experience hangs for a few seconds at a time, when Sm (browser as well as Mail/News) stops completely but other programs stay alive. I'm attributing it (rightly or wrongly) to checking my 4 mail accounts and my 2 newsgroup accounts (with many newsgroups at news.mozilla.org and one Usenet newsgroup on my ISP's news server). I don't know if it's the same problem as this bug but it doesn't bother me much anyway.

The Sm2 "New Mail" popup at bottom right of the screen is much smaller than Tb2's but AFAICT I even get those "hangs" when, after all, there is no new mail. (Or am I just not observant enough?)
Tony, I also see that Thunderbird is blocked when fetching new mail and spam-filtering it and esp. when moving it to a big folder. That's *not* the bug here, though.
Just tried it again, it happens when (and only when) I enable Preferences|General|When new mail arrives| [x] Show alert  .

I get a popup, which is cream-yellow, on the bottom right of the desktop (not Thunderbird window). It is first "dimmed" (not full color saturation, grey text etc.), then turns yellow with black text, then dims again and disappears. During the this time, CPU usage by Thunderbird is 100%, and it takes about 30 seconds (see comment 1 for exact figures).

Environment:
This is a fairly new and fast machine with Athlon 64 3500+ (single core), 2 GB fast RAM (of which only ~1 GB is used).
OpenSuSE 10.3 now (above was 10.1 and 10.2)
nvidia drivers with 3D support. I earlier used the free "nv" X11 driver.

To me, this just seem like the drawing implementation on Linux is simply not fit for purpose. It also is strange on Linux to see something on the desktop outside the app window, that's not custom on Linux.
(In reply to comment #21)
> I get a popup, which is cream-yellow, on the bottom right of the desktop (not

Cream-yellow? Are you sure you are using the default theme, from mozilla.org? With normal settings it's white/grayish with a blue border, but I suppose that color can come from the system setting also.
Yes, I sure use the default theme. I may have misdiscribed the color, or it comes from the system (KDE3, SuSE KDE theme).
Ben, istr there was a core bug that described something related or you mentioned. Do you recall any such thing?
You mean the color? Yes, that's probably a system color, nothing exciting.
I think Wayne has bug 523972 in mind. That's completely irrelevant to the bug, though.
(In reply to comment #21)
> To me, this just seem like the drawing implementation on Linux is simply not
> fit for purpose. It also is strange on Linux to see something on the desktop
> outside the app window, that's not custom on Linux.

I mean with regard to the above. sorry for not providing proper context.
regarding the high CPU usage (bleh)
Hey, when this happens, check the CPU Usage for PulseAudio, there have been some problems regarding it, that and System > Administration > Sound > Applications and you see pulseaudio flickering could cause this problem a better discription found here
http://ubuntuforums.org/showthread.php?t=1384140
There is no solution posted, but it could lead you to a cause, I was able to solve it by removing pulseaudio and installing esound to get the instructions go here.
http://ubuntuforums.org/showthread.php?t=1415518
I have KDE/Kubuntu 9.10 x64 system, but if you have Ubuntu, the link will give you Gnome/Ubuntu's how to install esound
The high CPU usage is exactly during the time of window fade in/out, not during the sound, so I don't think Pulse is relevant.
can someone get a profile or stacktrace ?
Given current informaiton, I don't see how we can move forward without one.
Keywords: stackwanted
This has only been confirmed on linux, correct?
OS: Linux → All
skip comment 31. my bad - chrome is still flipping fields on me :(
so while I'm here, is this seen with current trunk builds?
OS: All → Linux
wsmwk, see comment 17: "Please try to reproduce the bug yourself before asking me further questions."
This issue is very old. If it is not reproducible on the latest stock version of opensuse (11.3), it should be closed
No, it should not. Look guys, stop trying to close old bugs. They are valid until proven fixed. If you can't do anything to get it fixed, or prove that it's fixed, just leave it alone, please.

****Stop commenting, if you can't add information yourself.****

This has very little to do with the distro, and everything with the Mozilla implementation, and the device driver (I have an nvidia card, which has drivers nv, nvidia proprietary, or nouveau).

I just tried to reproduce it, and I'm not getting *any* alert anymore, although I enabled it in prefs, so I can't verify either way.
I came across this bug and tried to reproduce.

Nowadays Thunderbird is using libnotify if available (usually within
Gnome) and otherwise a home grown XUL notification.
I'm running on openSUSE 12.2 with nvidia (proprietary nvidia driver) and
see the XUL notification (which fades in and out) for new mails
everytime and haven't noticed a delay and CPU spike like described.
Sometimes it gets stuck a little bit if TB is busy within the UI main
thread I guess but only very shortly. 2 seconds max I'd say.

On my other machine running Gnome 3 I get native libnotify notifications
which are decoupled from the TB process anyway.

So I guess this one is about the XUL implementation of the notification. In that case I can basically confirm that the fade-in/out effect does not really look smooth but I cannot even measure the CPU load in that short phase it takes for me.

FWIW, I also never saw a similar bug reported @ openSUSE's bugzilla so it's really not a widespread issue I think.

(In reply to Ben Bucksch (:BenB) from comment #35)
> I just tried to reproduce it, and I'm not getting *any* alert anymore,
> although I enabled it in prefs, so I can't verify either way.

I fixed some notification issues with TB 14 (nothing performance or UI related; just to show them actually so what is your experience today?)
> So I guess this one is about the XUL implementation of the notification.

Indeed. libnotify didn't exist when I filed this.

> Sometimes it gets stuck a little bit if TB is busy within the UI main
> thread I guess but only very shortly. 2 seconds max I'd say.

That is a bug. Blocking the UI for 2 seconds is no good. You can't block the UI for more than 50ms. If you get a lot of mail, this can be significant.
(In reply to Ben Bucksch (:BenB) from comment #37)
> > Sometimes it gets stuck a little bit if TB is busy within the UI main
> > thread I guess but only very shortly. 2 seconds max I'd say.
> 
> That is a bug. Blocking the UI for 2 seconds is no good. You can't block the
> UI for more than 50ms. If you get a lot of mail, this can be significant.

There is a misunderstanding. The popup never is the source of the UI block but if the TB UI is laggy because something is busy in the main thread it gets affected too. That's at least my observation.
Does this reproduce when using something other than gnome?
Summary: New Mail alert popup takes 100% CPU for 10 secs → New Mail alert popup takes 100% CPU for 10 secs. XUL-based notification
Whiteboard: [needs profile]
Depends on: 854093
Severity: major → normal

According to Magnus in Bug 380987 "we use native notifications by default now on linux (and mac)". So if an issue still exists, it's not our bug?

Flags: needinfo?(mkmelin+mozilla)

I kind of think this bug still exists, and is windows too. But haven't seen it for a while. I don't think it's the actual notification that's the problem but how we try to show it while going out to grab more information at the same time.

Flags: needinfo?(mkmelin+mozilla)
Severity: normal → S3
See Also: → 1830641

Steve, Tristan, are you able to reproduce this and provide a performance profile?

Flags: needinfo?(steve)
Flags: needinfo?(psychonaut)
Summary: New Mail alert popup takes 100% CPU for 10 secs. XUL-based notification → New Mail alert/notification popup takes 100% CPU for 10 secs during fade in/out with KDE. XUL-based notification
Blocks: 1830641
See Also: 1830641

I have the popup running on one machine with openSUSE 15.4 and do not notice any of the issues mentioned here. I long while back I used to get the 100% CPU thing without popups running.

Flags: needinfo?(steve)

When I get new mail in Thunderbird, CPU usage spikes to about 40% regardless whether or not I have the system notification enabled. With the system notification enabled, I don't see the extremely slow fading by the OP. Looks like a completely normal system notification to me.

Flags: needinfo?(psychonaut)

I also see a spike in CPU, to about 35-40% for a few seconds in TB102.12, 60% in 115.2.2 and for slightly longer. Generally CPU use seems higher in 115.2.2 for any activity.

Flags: needinfo?(steve)
You need to log in before you can comment on or make changes to this bug.