Closed Bug 1249945 Opened 8 years ago Closed 6 years ago

CPU hog in Windows 10

Categories

(Calendar :: General, defect)

Lightning 4.0.5.1
x86_64
Windows 10
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: scovich, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: perf)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0
Build ID: 20160210153822

Steps to reproduce:

Click on any part of TB to give it focus (e.g. clicking on a not-selected account or trying to type in a message window), then alt-tab away to the task manager and watch what happens. Or, just wait around and let TB start chugging away for no good reason at all.


Actual results:

On my two-core laptop the usage meanders around between 14% (1/3 CPU) and 65% (1 1/3 CPU) for the next 30 or 40 seconds. There are no animations showing, no indication that TB is doing anything, but CPU is super high and typing is super laggy.

A 20-second Cleopatra profile taken during the CPU usage spike shows the following:

100% - Startup::XRE_Main
 -> 54% - NtWaitForMultipleObjects
 -> 41% - Timer::Fire
      -> 35% - nsJSContext::RunCycleCollectorSlice

I don't remember this being a problem before I upgraded from win7 to win10, and it's been a consistent problem ever since the upgrade. 


Expected results:

CPU should only be busy if TB is actually doing something useful.
OS: Unspecified → Windows 10
Hardware: Unspecified → x86_64
It seems that restarting TB helps a bit: the CPU spikes are less frequent, less intense, and shorter. But after a few hours the problem is back. 

Memory footprint might be part of the issue here, it was nearly 800MB just before I started profiling, compared with only 220MB after restarting.
Need URL for your profile.
Also, does this happen with all addons disabled except profiler?
Flags: needinfo?(scovich)
Keywords: perf
Unfortunately, I can't seem to find the profile anymore. I restarted TB to disable plugins, and there doesn't seem to be a way to enumerate profiles that were taken in the past. If there's a way to dredge those up let me know.

Meanwhile, I've been running 24h now with all plugins disabled, can't repro. TB has a 210MB RAM footprint. 

I suspect that memory fragmentation and GC issues are the issue here, and the only non-trivial plugin I was running is Lightning (the others were tiny things like key rebinding, disabling click-to-sort on the mail column headers, etc.). I can only go so long without my calendar anyway, so I'll re-enable that one plugin and see if that brings the problem back.
Flags: needinfo?(scovich)
(In reply to Ryan Johnson from comment #3)
> Unfortunately, I can't seem to find the profile anymore. I restarted TB to
> disable plugins, and there doesn't seem to be a way to enumerate profiles
> that were taken in the past. If there's a way to dredge those up let me know.

I'm checking.  but not optimistic.


> I suspect that memory fragmentation and GC issues are the issue here, and
> the only non-trivial plugin I was running is Lightning (the others were tiny
> things like key rebinding, disabling click-to-sort on the mail column
> headers, etc.). I can only go so long without my calendar anyway, so I'll
> re-enable that one plugin and see if that brings the problem back.

thanks. please do
Flags: needinfo?(scovich)
Heh. I tried to re-enable profiling and was unable to reach my newly profile, but the original one was still there. http://people.mozilla.org/~bgirard/cleopatra/?1457226183126#report=1f858b29d08a38660cadbe6dac6f0db0a12c3ec1

Meanwhile, having Lightning enabled did seem to increase memory usage. After 24h or so it had bumped memory usage to 350MB or so, and there were hints that the CPU hog behavior was returning (albeit still on a smaller scale than what the above profile measured).
Flags: needinfo?(scovich)
50% in cycle collector nsCycleCollector::collectSlice is consistent with high memory usage.

Other calendar memory issues http://mzl.la/1L9BoQq
Component: Untriaged → General
Product: Thunderbird → Calendar
Version: 38 Branch → Lightning 4.0.5.1
Does starting Windows 10 in safe mode help the performance issue?
Flags: needinfo?(scovich)
(In reply to Wayne Mery (:wsmwk, use Needinfo for questions) from comment #7)
> Does starting Windows 10 in safe mode help the performance issue?

Sorry, I won't be able to try that. I use this compute for work and the bug takes a day or two of normal computer use to manifest. Nothing happens if it just sits idle for 48 hours over the weekend.
Flags: needinfo?(scovich)
See Also: → 686495
Depends on: 683651
Ryan, how are things with version 60?  Better, worse, same?
Flags: needinfo?(scovich)
Whiteboard: [closeme 2018-09-17]
I just put my laptop in airplane mode and hit "Get Messages", which put CPU util at ~40% of one CPU. That might be an improvement--I think it used to be more like 80%--but it's certainly not remotely good. Then again, Thunderbird sucks down 10-20% CPU at any given moment even when sitting idle, so yeah... CPU hog all around.

I'm not on v60, tho... latest release channel says I'm at latest with 52.9.1?
Flags: needinfo?(scovich)
(In reply to Ryan Johnson from comment #10)
> I just put my laptop in airplane mode and hit "Get Messages", which put CPU
> util at ~40% of one CPU. That might be an improvement--I think it used to be
> more like 80%--but it's certainly not remotely good. 

It seems to me the above describes a different issue than your original report, and is not something we would discuss here.

> Then again, Thunderbird sucks down 10-20% CPU at any given moment even when sitting idle, so yeah...
> CPU hog all around.

Without lightning?
 
> I'm not on v60, tho... latest release channel says I'm at latest with 52.9.1?

Version 60 can be downloaded from https://getthunderbird.com
Flags: needinfo?(scovich)
Resolved per whiteboard
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Flags: needinfo?(scovich)
Resolution: --- → INCOMPLETE
Whiteboard: [closeme 2018-09-17]
You need to log in before you can comment on or make changes to this bug.