Closed Bug 350342 Opened 18 years ago Closed 15 years ago

Sunbird hangs when dismissing all events - CPU goes to 100% for few minute

Categories

(Calendar :: Alarms, defect)

x86
Windows XP
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: damian.publicemail, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20060825 Calendar/0.3a2+

when you have plenty of missed events and try to dismiss them all Sunbird does not response for a while - sometimes really long time, depends how many events you have

Reproducible: Always

Steps to Reproduce:
let's have some extremely test, which you can do it also by mistake, so...
1. create new profile
2. create new event: from=2004-08-27 to:2006-08-27 +repeat:every day, repeat forever
3. press more>> and and set alarm: 15 minutes before
4. fill title, click ok to create event
   -> Calendar alarm dialog shows up
6. Open Task manager under Windows to track CPU or top under linux
7. Press Dismiss for at least few events and observe how Sunbird consume CPU - up to 100% for ~1sec
8. Press Dismiss all and again observe CPU
Actual Results:  
Sunbird hangs, does not response, does not refresh window

you can kill process or wait more than one minute and see that Sunbird started from approximately 25000K (memory) went up to 1Mega

Expected Results:  
If this is required to modify all events, Sunbird should at least response and refresh window

also Sunbird grows to much - lack of memory?
Flags: blocking0.3?
Version: unspecified → Trunk
I can confirm it. I think calendar shouldn't allow to create an event with start date before today...
I agree that this is unfortunate, but it's not a 0.3 blocker.  It could potentially block 1.0, however.
Flags: blocking0.3? → blocking0.3-
Component: General → Alarms
QA Contact: general → alarms
I can confirm this and with a much smaller test case.
Using Windows XP and build: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20061031 Calendar/0.4a1

1. Create an event that starts one week ago from today
2. Set the event to recur daily with an alarm that happens 15mins before the event fires.
3. You should see the Calendar Alarm window pop up with 7 alarms in it.
4. Click Dismiss All button.

--Actual behavior--
Sunbird will completely hang for a few seconds. In that time, the cursor will NOT change to the hour glass (testing on windows), and Sunbird's UI will be completely unresponsive. The CPU usage does shoot to 100% briefly. 
Performing some very unofficial stopwatch performance testing on my Windows XP box (2.50Ghz, 1.5Gb RAM) I see the following timings:
7 alarm events, click Dismiss all: Sunbird hangs for 5s
14 alarm events, click Dismiss all: Sunbird hangs for 24s
21 alarm events, click Dismiss all: Sunbird hangs for 51s
28 alarm events, click Dismiss all: Sunbird hangs for 87s
After all this testing, I decided to run the 7 alarm event test to see how much the extra events might be skewing the timings:
7 alarm events, click Dismiss all: Sunbird hung for 9s, so the additional events are slowing it down some.

Doing the dismiss all, I am also noticing Sunbird's memory usage continues to grow each time I do this, and then it shrinks slightly once the app finishes pounding the CPU. I know that we are adding certain attributes to the ICS files, so I do not know if this is expected behavior or not, but for what it's worth Sunbird is currently using 75Mb of virtual memory on my system.

Other than Sunbird, the computer is essentially idle when I was doing the test.

-- Expected Behavior --
Ideally, this is a performance problem that we could look into. Perhaps it is related to other performance bugs. at the very least, Sunbird should give indication that it is busy and should probably display a progress bar or some status of how long it will take.

Since Sunbird does not crash, and the program is still usable after the dismiss all completes, I am going to reduce the severity to Major.
Confirming this bug.
Severity: critical → major
Status: UNCONFIRMED → NEW
Ever confirmed: true
Can not reproduce with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.6pre) Gecko/20091112 Calendar/1.0pre

->W4M
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.