Closed Bug 685758 Opened 13 years ago Closed 13 years ago

Simple web page causes zombie compartment

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: billm, Unassigned)

References

Details

(Whiteboard: [MemShrink])

Attachments

(1 file)

Attached file page in question
Steps to reproduce:
1. Load the page
2. Wait until the counter hits 4000 or so
3. Go to about:memory
4. Hit GC and CC a lot. Don't hit "Minimize memory usage".

The page's compartment (which should be holding about 700MB of memory) won't go away unless I press the minimize button. No amount of GCing and CCing will kill it. I waited 5 minutes and it still won't go away. I think once I did see it go away if I started browsing for a while.

My suspicion is that there's a cache holding on to something, and it gets flushed by the memory pressure event. I'm filing this under JS by default, but I suspect that it's not a JS bug.

This is in a fresh profile with no extensions.
In case it wasn't clear, when I said "Go to about:memory" in step 2, I meant "Navigate away from the page by going to about:memory".
A page stays in the bf cache when its containing tab is navigated from (until some unspecified number of navigations).  This makes clicking "back" really fast.  If you click History -> Clear Recent History (Last Hour), then the history goes away and the compartment should get freed by GC.  IIUC, this is everything working by design so there isn't a bug.
This doesn't happen if the tab in which the page was is closed. But if the tab remains open (by browsing to about:memory and staying there for example), then it happens. Minimize memory usage fixes it though. Keeping the tab open but browsing to multiple web pages in succession also fixes this.

So I suspect the issue here is that the bfcache keeps the page alive, as all those symptoms fit that. Maybe we should have some memory limit on the bfcache? Another idea that comes to mind is reporting the bfcache in about:memory (something like: [bfcache] next to the compartment's name)?
Oops.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
> Another idea that comes to mind is reporting the bfcache in
> about:memory (something like: [bfcache] next to the compartment's name)?

That'd be cool.  Is it hard?
(In reply to Nicholas Nethercote [:njn] (on vacation Sep 12--Oct 17) from comment #5)
> > Another idea that comes to mind is reporting the bfcache in
> > about:memory (something like: [bfcache] next to the compartment's name)?
> 
> That'd be cool.  Is it hard?

I filed bug 686079 to add about:memory details for the bfcache. A wip patch to report the # of entries there was very easy. Hopefully the rest will not be too hard ;)
Status: RESOLVED → UNCONFIRMED
Ever confirmed: false
Resolution: INVALID → ---
(Not sure why my comment changed the bug status. Sorry about the bugspam.)
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: