Closed Bug 730833 Opened 14 years ago Closed 12 years ago

Opening and closing many windows causes Firefox to use more memory

Categories

(Core :: XUL, defect)

10 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: passfree, Unassigned)

Details

(Whiteboard: [MemShrink:P3])

Attachments

(1 file)

Attached file crash-012.zip
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.22 (KHTML, like Gecko) Chrome/19.0.1049.3 Safari/535.22 Steps to reproduce: If you open a window via window.openDialog or window.open you will notice that it leaks a tiny amount of memory. If we repeat this test let's say 10,000 times this mounts to a lot of leaked data. Dumping the JS heap usually results into hundreds of references of ChromeWindow. I have attached a simple xulrunner application which demonstrates the problem. Simply execute the application and wait for 3-4 minutes. While the application is running monitor its memory usage. !!! NB: the application was tested on Snow Leopard.
Summary: opening windows leak → opening windows leaks
Whiteboard: [MemShrink]
Whiteboard: [MemShrink] → [MemShrink:P3]
Attachment #600925 - Attachment mime type: application/octet-stream → application/zpi
Attachment #600925 - Attachment mime type: application/zpi → application/zip
This extension is doing setInterval(function () { openDialog('chrome://main/content/dialog.xul', '', 'chrome,modal,centerscreen', {a:1, b:2}); }, 1000); and dialog.xul does function handleDOMContentLoadedEvent(event) { if (event.target != document) { return; } window.close(); } addEventListener('DOMContentLoaded', handleDOMContentLoadedEvent, false); So we're opening *and closing* lots of windows. > Dumping the JS heap usually results into hundreds of references of ChromeWindow. It sounds like you're not running the GC before you measure memory usage (see the button at the bottom of about:memory). Either that, or the extension is somehow holding a reference to each of the windows it creates. I seriously doubt this is exposing a real bug in Firefox, so I'm tempted to mark this bug as incomplete, but if you want to dig into it, we can...
Summary: opening windows leaks → Opening and closing many windows causes Firefox to use more memory
no response to comment 1, "I seriously doubt this is exposing a real bug in Firefox", so => invalid
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: