Closed Bug 375929 Opened 17 years ago Closed 16 years ago

Seamonkey mail leaks a huge amount of memory while downloading mail

Categories

(SeaMonkey :: MailNews: Message Display, defect)

1.8 Branch
x86
Linux
defect
Not set
critical

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: baldauf--2015--bugzilla.mozilla.org, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20061107 SUSE/1.1.1-0.1 SeaMonkey/1.1.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.2) Gecko/20061107 SUSE/1.1.1-0.1 SeaMonkey/1.1.1

My seamonkey application suite crashes now 2..3 times a day by exceeding the virtual memory limit of 2GB on my machine.

I tracked the reason by running this little bash script:

while true; do echo -n "$(date) "; ps auxf|grep seamonkey-bin|grep -v grep; sleep 10; done


It produced following log. Watch the column which starts with "430132", as this is the amount of virtual memory allocated to seamonkey.

Fr 30. Mär 04:43:28 NZST 2007 root     15621  3.1 11.3 430132 233156 ?       Sl   01:27   6:09  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 04:43:39 NZST 2007 root     15621  3.1 11.3 430132 233156 ?       Sl   01:27   6:10  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 04:43:49 NZST 2007 root     15621  3.1 11.3 430132 233156 ?       Sl   01:27   6:10  |   \_ /usr/lib/seamonkey/seamonkey-bin

Here, I send the machine to suspend2RAM, and resumed 9 hours later

Fr 30. Mär 13:54:23 NZST 2007 root     15621  3.1 11.3 430132 233156 ?       Rl   10:38   6:10  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:54:33 NZST 2007 root     15621  3.1 11.3 430132 233156 ?       Sl   10:38   6:10  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:54:43 NZST 2007 root     15621  3.1 11.3 430132 233156 ?       Sl   10:38   6:10  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:54:53 NZST 2007 root     15621  3.1 11.3 430132 233156 ?       Sl   10:38   6:11  |   \_ /usr/lib/seamonkey/seamonkey-bin

Now I open the Mail part of the application suite (before, only the browser part was used). After a while, seamonkey starts downloading 393 e-mail messages.

Fr 30. Mär 13:55:04 NZST 2007 root     15621  3.1 11.8 440652 244380 ?       Rl   10:38   6:12  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:55:14 NZST 2007 root     15621  3.1 11.8 440048 244072 ?       Sl   10:38   6:13  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:55:24 NZST 2007 root     15621  3.1 11.8 440048 244072 ?       Sl   10:38   6:14  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:55:34 NZST 2007 root     15621  3.1 11.8 440048 244072 ?       Sl   10:38   6:14  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:55:44 NZST 2007 root     15621  3.1 11.9 441640 245648 ?       Rl   10:38   6:15  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:55:54 NZST 2007 root     15621  3.1 14.6 497852 301904 ?       Sl   10:38   6:18  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:56:04 NZST 2007 root     15621  3.2 17.4 555948 359964 ?       Sl   10:38   6:21  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:56:14 NZST 2007 root     15621  3.2 19.1 590580 394536 ?       Dl   10:38   6:23  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:56:24 NZST 2007 root     15621  3.2 21.4 636808 440740 ?       Sl   10:38   6:25  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:56:34 NZST 2007 root     15621  3.2 23.5 679984 483844 ?       Sl   10:38   6:27  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:56:44 NZST 2007 root     15621  3.2 24.0 690920 494844 ?       Sl   10:38   6:29  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:56:54 NZST 2007 root     15621  3.2 26.1 734024 537944 ?       Sl   10:38   6:31  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:57:04 NZST 2007 root     15621  3.2 26.6 745416 549288 ?       Sl   10:38   6:32  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:57:14 NZST 2007 root     15621  3.2 28.6 785196 589036 ?       Rl   10:38   6:34  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:57:25 NZST 2007 root     15621  3.3 29.8 810492 614360 ?       Sl   10:38   6:35  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:57:35 NZST 2007 root     15621  3.3 31.9 853752 657604 ?       Sl   10:38   6:37  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:57:45 NZST 2007 root     15621  3.3 31.9 853756 657612 ?       Sl   10:38   6:38  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:57:55 NZST 2007 root     15621  3.3 31.9 854152 657880 ?       Sl   10:38   6:39  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:58:05 NZST 2007 root     15621  3.3 31.9 853264 657000 ?       Sl   10:38   6:41  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:58:15 NZST 2007 root     15621  3.3 31.9 853264 657000 ?       Sl   10:38   6:42  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:58:25 NZST 2007 root     15621  3.3 31.9 853264 657000 ?       Sl   10:38   6:43  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:58:35 NZST 2007 root     15621  3.3 31.9 853264 657000 ?       Sl   10:38   6:45  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:58:45 NZST 2007 root     15621  3.3 31.9 853264 657000 ?       Rl   10:38   6:46  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:58:55 NZST 2007 root     15621  3.3 31.9 853264 657000 ?       Sl   10:38   6:48  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:59:05 NZST 2007 root     15621  3.3 31.9 853264 657000 ?       Sl   10:38   6:49  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:59:15 NZST 2007 root     15621  3.4 31.9 853264 657000 ?       Rl   10:38   6:50  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:59:25 NZST 2007 root     15621  3.4 31.9 853264 657000 ?       Sl   10:38   6:51  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:59:35 NZST 2007 root     15621  3.4 33.9 894244 698092 ?       Sl   10:38   6:54  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:59:46 NZST 2007 root     15621  3.4 33.9 894244 698096 ?       Sl   10:38   6:55  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 13:59:56 NZST 2007 root     15621  3.4 33.9 894244 698096 ?       Sl   10:38   6:56  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:00:06 NZST 2007 root     15621  3.4 33.9 895740 699480 ?       Rl   10:38   6:58  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:00:16 NZST 2007 root     15621  3.4 33.9 895740 699480 ?       Rl   10:38   6:59  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:00:26 NZST 2007 root     15621  3.4 33.9 895740 699480 ?       Sl   10:38   7:01  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:00:36 NZST 2007 root     15621  3.4 33.9 895740 699480 ?       Sl   10:38   7:02  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:00:46 NZST 2007 root     15621  3.4 33.9 895740 699480 ?       Sl   10:38   7:03  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:00:56 NZST 2007 root     15621  3.4 33.9 895740 699480 ?       Sl   10:38   7:05  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:01:06 NZST 2007 root     15621  3.5 33.9 895740 699480 ?       Sl   10:38   7:06  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:01:16 NZST 2007 root     15621  3.5 33.9 895740 699480 ?       Sl   10:38   7:07  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:01:26 NZST 2007 root     15621  3.5 34.5 906580 710436 ?       Sl   10:38   7:08  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:01:36 NZST 2007 root     15621  3.5 35.8 934024 737772 ?       Sl   10:38   7:10  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:01:47 NZST 2007 root     15621  3.5 36.9 955888 759652 ?       Sl   10:38   7:11  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:01:57 NZST 2007 root     15621  3.5 38.3 986128 789824 ?       Rl   10:38   7:13  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:02:07 NZST 2007 root     15621  3.5 41.4 1048720 852416 ?      Rl   10:38   7:16  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:02:17 NZST 2007 root     15621  3.5 43.0 1081868 885608 ?      Sl   10:38   7:18  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:02:27 NZST 2007 root     15621  3.5 44.2 1106864 910464 ?      Rl   10:38   7:20  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:02:37 NZST 2007 root     15621  3.5 44.2 1106864 910404 ?      Sl   10:38   7:21  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:02:47 NZST 2007 root     15621  3.5 44.2 1106864 910404 ?      Sl   10:38   7:21  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:02:57 NZST 2007 root     15621  3.5 44.2 1106864 910404 ?      Sl   10:38   7:21  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:03:07 NZST 2007 root     15621  3.5 44.2 1106864 910596 ?      Sl   10:38   7:22  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:03:17 NZST 2007 root     15621  3.5 44.2 1106864 910596 ?      Sl   10:38   7:22  |   \_ /usr/lib/seamonkey/seamonkey-bin
Fr 30. Mär 14:03:27 NZST 2007 root     15621  3.5 44.2 1106864 910596 ?      Sl   10:38   7:22  |   \_ /usr/lib/seamonkey/seamonkey-bin

Downloading e-mail messages is now complete. I did not do anything with seamonkey in the meantime.

So we start from 440652 KiB virtual memory (244380 KiB resident resource set) and we end at 1106864 KiB virtual memory (910596 KiB resident resource set). The difference is 666212 KiB virtual memory and 666216 KiB RSS.

Even when used on a 2GB machine, this is really too much for just opening and downloading e-mail. One could argue that from 440652 KiB to 853264 KiB, this is just opening the Mail window and initializing the Mail component, but definitely eating memory from 853264 KiB to 1106864 KiB (at least 253600 KiB) for just downloading 393 e-mail message is definitely too much.

Over the time, the allocated virtual memory increases to 2GiB, at which seamonkey crashes. (On my machine, the virtual memory limit is 2GiB).

Reproducible: Always

Steps to Reproduce:
1. Open Seamonkey Mail
2. Download lots of e-Mail messages (from a POP3 server)

Actual Results:  
Seamonky Mail allocates huge amounts of memory and eventually crashes by reaching a limit of virtual memory.

Expected Results:  
All should be fine. Seamonkey Mail should barely allocate some memory.
Do you have any extensions installed?
Version: unspecified → 1.8 Branch
I did not add any extensions. However, "spellchecker" and "enigmail" are installed by default (contained in the RPM package).


What is also interesting to note is that seamonkey leaks filedescriptors. The filedescriptors point to ".msf" files. Currently, there are 11 ".msf" files referenced in a certain order (respectively to the filedescriptor number), and after one block of 11 ".msf" files finished, the next block of 11 ".msf" files begins, up to filedescriptor 802 (currently).

It is unclear for me why these ".msf" files are "selected" from my other ".msf" files which I have, but this is currently the case. As Mozilla Mail is my e-mail client since the days of Netscape 1.1 Gold or so, I have currently 609 ".msf" files and about 100 mail filter rules.
I'm pretty sure that seamonkey mail leaves .msf files open while it's running (on purpose).  Are you saying that it reopens the same 11 .msf files over and over again?
> Are you saying that it reopens the same 11 .msf files over and
> over again?
Yes, I am saying this.(In reply to comment #3)

do you see this on the trunk, or 1.8.1 branch-based Seamonkey?
He's on 1.8.1 (SeaMonkey 1.1.1)
I think that I have this checkin applied.

I'm using this build: http://fr2.rpmfind.net//linux/RPM/suse/updates/10.2/i386/rpm/i586/seamonkey-mail-1.1.1-0.1.i586.html 
which was built on "Mon Mar 5 10:50:09 2007".

Also, before seamonkey 1.1.1, I used seamonkey-mail-1.0.99-18.i586.rpm (this package: http://rpm.pbone.net/index.php3/stat/4/idpl/3697862/com/seamonkey-mail-1.0.99-18.i586.rpm.html , built on "2006-11-28 03:05:26"). With this older version of seamonkey-mail, I also had crashes occasionally, but not as frequent as now and apparently not due to (this) memory leak (my system monitor bar for used swap space did not increase that fast).


I'm also seeing what appears to be a gigantic memory leak in Seamonkey, this time when it accesses a news reader.  Seamonkey starts at 22Mb or so.  As soon as the Mail & Newsgroup window opens a news server it jumps up a lot, often to 130Mb. If it doesn't jump immediately, then do file -> get new messages, and that will do it  When the Mail & Newsgroup window is closed the application stays at 130Mb.  Even after reducing it to a single text only window and deleting the day's history file it's still using 130Mb.  

Also the .msf files are in some cases very large.  The biggest one 
in my profile was:

comp.lang.c.msf   41Mb

To see what would happen, I unsubscribed from comp.lang.c, and the memory
usage immediately dropped from 130Mb to 76Mb. When I resubscribed it went up
to 154Mb!  I marked all messages read and it stayed at 154Mb.  The new
version of the comp.lang.c.msf file was 44.7Mb.

This is on Windows XP, with Seamonkey 1.1.2 and 1.1.3.  Memory sizes from the
"Mem Usage" column in Windows Task Manager.

I don't know what Seamonkey keeps in the .msf file, but 44.7Mb on disk and
76Mb of (mapped?) memory seems a might high to me for a single newsgroup where all messages have been marked as "read"!  I also don't see the point in Seamonkey keeping this file mapped once the Mail & Newsreader has closed.  Or at
least provide some way for the end user to disable that behavior.
One possibly related observation - the newsgroup .dat and .msf  are not immediately deleted when upon unsubscribing from a newsgroup.  In some cases, apparently, they are never deleted, at least judging by the ones laying about in my profile that have not been subscribed to for a long time, and are no longer
shown in the newsgroups list.
Xuân, do you still see this using a newer build?
David, bug 316929 (for the checkin you mentioned) should in SM 1.1.1 afaict
bienvenu, can he safely delete pop .msf files for those folders?


David in comment #10:
> One possibly related observation - the newsgroup .dat and .msf  are not
> immediately deleted when upon unsubscribing from a newsgroup.  In some cases,
> apparently, they are never deleted, at least judging by the ones laying about
> in my profile that have not been subscribed to for a long time, and are no
> longer shown in the newsgroups list.

this has always been the case and should not affect memory usage - newsgroups which are not subscribed shouldn't have their folders loaded - this information is contained in the .rc files.  see other news bugs for info, for example bug 400526.  FWIW, I don't think your memory usage is abornmal.
yeah, they can be safely deleted. It's a bug that they're not deleted when you unsubscribe, IMO.
Due to big changes in memory management, i think this bug should retested. I don't have problems with trunk builds. Anyone tested it with latest 1.1 seamonkey branch builds ?
No reply to comment #14 in 16 days - resolving INCOMPLETE. If you REOPEN, please paste the UA string found after "Build Identifier" on the about: page for a build with the bug.
Status: UNCONFIRMED → RESOLVED
Closed: 16 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.