Closed Bug 93013 Opened 23 years ago Closed 23 years ago

memory bloats every time we switch newsgroups in the folder pane.

Categories

(SeaMonkey :: MailNews: Message Display, defect)

x86
Windows 2000
defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stephend, Assigned: Bienvenu)

References

Details

(Keywords: memory-leak)

Build ID:  2001-07-31-03 Windows 2000 (this bug has been around for a long time,
I bet).

Summary:  We're leaking memory every time we switch newsgroups in the folder pane.

Steps to Reproduce:

Saw this on Tom's machine (Tom, can you please add/correct information as
needed?  Thanks)

1.  Load Mail/News. (Note the memory in use on the system with Task Manager)
2.  Have a folder pane populated with 20 rather large newsgroups. (Each one
35,000+ groups or so).
3.  Click from newsgroup to newsgroup (letting each one load).

Expected Results:

If memory is allocated for a newsgroup in the folder pane when in use, when you
click on different newsgroup, the memory from the old newsgroup should be
de-allocated (freed) when clicking to the next one, which should then get its
own allocation.

An example:

Tom started at around 32megs allocated from Mozilla, just having Navigator and
Mail/News loaded.  He clicked on a newsgroup, and watched it grow to around 33.
 Then, he clicked on another newsgroup, and it hovered ~34.  By the time he was
done selecting newsgroups in the folder pane (something like 20 newsgroups), we
saw that his memory usage was much higher.  One newsgroup in particular (an
internal one with 72,000 messages, filed seperately for a different reason in
bug 87164) took us up around 90+ megs.  

When my mozilla build finishes, I'll try to get some Purify data on the leaks.  

Note:  It's known that we leak when switching folders, and newsgroups share part
of the same code path, so this is very closely related to or a DUP of that bug.
QA Contact: esther → stephend
I just searched for other leaks (using folder and mlk as criterias), and found
only two other bugs, that don't seem too related to this, bug 50531 and bug 87974.
This is a pretty bad leak imo.  Anyone who uses newsgroups a lot is going to
quickly see their memory disappear.  Marking nsBranch for lack of better keyword.
Keywords: nsBranch
Mightn't this be related to bug 64868?
Keywords: nsBranchnsbranch
Blocks: 92580
Blocks: 99230
not an emojo stopper.
Keywords: nsbranchnsbranch-
taking - might simply be because the db is not getting closed, for which I'm
working on a fix.
Assignee: sspitzer → bienvenu
I checked in the fix for bug 95685 - that should make this better.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
We're still leaking memory until shutdown (at which point, we're returning all
the memory, which is *great* news).

Here's what I did:

1.  Subscribed to 20 newsgroups on news.mozilla.org (just went from n.p.m.access
down to n.p.m.general (then added netscape.test and netscape.public.test).
2.  Made sure I got all the new headers, so I wouldn't introduce header
downloading into the mix when I ran the Task Manager.  Shutdown.
3.  Simply clicked on each newsgroup, going down the list, waiting for each to
load in the folder pane.

My Results, using Task Manager (I also have a leak log for just clicking between
2 newsgroups, and it's extremely current):

* Started with 133416K allocated
* After clicking on the 20 newsgroups, I had 159112K allocated
* On shutdown, we went down to 111712K.

I really don't think this is fixed ;-(

We still have lots of mork leaks...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
you should try it with an older build and see what the difference is - I think
we're freeing much more memory - otherwise, bug 103824 wouldn't exist. It may
depend on whether headers get downloaded for the newsgroup - there are some
situations where we don't close the db but I'm having a hard time figuring out
how to reproduce it.
Summary: Leaking memory every time we switch newsgroups in the folder pane. → memory bloats every time we switch newsgroups in the folder pane.
Build        |Mem Start   |Mem Done    |Mem Shutdown
-----------------------------------------------------
0.9.2        |106056k     |155532k     |86676k
0.9.4        |103212k     |151416k     |81018k
Trunk        |133416k     |159112k     |111712k

Okay, you're right, David ;-) 

With 0.9.2 and 0.9.4, we had twice as much memory being allocated when going
from folder to folder:

49476k - 0.9.2 (difference from mem done minus mem start)
48204k - 0.9.4                     " 
25696k - Trunk                     "

Also of interest is that 0.9.2 doesn't have the outliner widget in the folder
pane, whereas 0.9.4 and the trunk of course do (there is around a meg of
difference between those two builds' memory usage). 
No longer blocks: 92580
Blocks: 107067
Keywords: nsbranch-
Keywords: nsbeta1+
seems to be fixed with mork landing.
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
I've morphed this bug more times than a Power Ranger, and now it's time to
verify it.  We no longer leak Mork (as far as Purify can tell), and we're *much*
improved over our old behaviors.  I still see leaks, but this is code outside of
mail/news and I'll be working with those engineers to track it down.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.