Closed Bug 123279 Opened 23 years ago Closed 22 years ago

Mozilla doesn't release memory used for multiple windows

Categories

(SeaMonkey :: General, defect, P2)

x86
Windows 2000
defect

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.0

People

(Reporter: DomIncollingo, Assigned: dp)

References

()

Details

(Keywords: memory-footprint)

Attachments

(1 file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.8+)
Gecko/20020201
BuildID:    2002020103

Each time a new Navigator Window is opened by choosing File -- New Navigator
Window, Mozilla memory usage increases.  However, the additional memory is not
released when the subsquent Navigator Windows are closed.

Reproducible: Sometimes
Steps to Reproduce:
1.Launch Windows Task Manager to monitor memory usage.
2.Launch Mozilla and navigate to http://www.yahoo.com/  (This is my home page).  
3.Windows Task Manager shows Mozilla memory utilization at 18 MB.
4.Launch 4 additional Navigator Windows by choosing File -- New Navigator
Window.  The four additional Navigator Windows should navigate to
http://www.yahoo.com/
5.Windows Task Manager shows Mozilla memory utilization at 25 MB.
6.Close 4 of the Navigator Windows.  Only the first Navigator Windows remains opens.
7.Windows Task Manager shows Mozilla memory utilization at 24 MB.  It remains at
24 MB for several minutes (perhaps indefinitely).

Actual Results:  Of the 7 additional MB that are allocated when 4 additional
Navigator Windows are opened, only one MB of memory is released when the 4
additional Navigator Windows are closed.

Expected Results:  Mozilla memory usage should go back down to 18 MB when the 4
additional Navigator Windows are closed.

Running build 2002020103 on Win 2K with 512 MB of RAM.  Memory cache is set to
1024 K.  I did not clear cache prior to running this test.
I've noticed the same behavior for Mozilla Mail.  Steps to reproduce:

1.Launch Mozilla and render http://www.yahoo.com/ (my home page)
2.Memory usage (mozilla.exe in Mem Usage column of task manager) is 18 MB.
3.Launch mozilla mail: Tasks -- Mail & Newsgroups
4.Memory usage (mozilla.exe) is 23 MB.
5.Close mozilla mail, leaving only the browser (www.yahoo.com) open.
6.Memory usage (mozilla.exe) is 22.5 MB.

Memory usage should go back down to 18 MB when Mail & Newsgroups window is closed.
Summary: Mozilla doesn't release memory used for multiple navigator windows → Mozilla doesn't release memory used for multiple windows
It aint that simple. Even if the code deallocated all the memory, it is highly
unlikely that we would see the number reported in windows task manager go down
because

a) the allocator (malloc) returns memory only if the unused memory is over a
threshhold

b) the free memory available is at the end of the VM space

see http://www.mozilla.org/projects/footprint/footprint-guide.html

That is not to say mail and navigator do release the memory. It is most likely
that most of the memory is not released. We are trying to see if that is a bad
thing and how it would become a good thing to release that memory.

Maybe I can take this bug.
Assignee: asa → dp
Status: UNCONFIRMED → NEW
Ever confirmed: true
per footprint plan, we need to make sure we release memory no longer needed.
This bug should address browser windows.
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → mozilla0.9.9
Keywords: footprint, nsbeta1
Target Milestone: mozilla0.9.9 → mozilla1.0
Keywords: nsbeta1nsbeta1+
Attached image footprint graph
Here is a footprint graph which shows: app startup, open window (using ctrl-N)
5 times and closing window (using alt-F4) 5 times, then shut down.

graph indicates that we are releasing un-used memory after each window close.  


graph is generated using spacetrace, based on trace-malloc data, which hooks
into all malloc and free.
marking bug FIXED.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: