Background: I'm currently working on an intranet site that makes use of the MochaUI library (working from the virtual desktop demo). I'm using Mootools 1.2.4 and MochaUI 0.9.7. The windows that are opened in my "virtual desktop" implementation load their content via iframes. Some of the loaded pages are pretty hefty in terms of css and scripting, so it's important that Window objects are adequately garbage collected when the user closes a window. This is ostensibly taken care of by the library (it does do a fair job when using Firefox).
Update The originally posted question had become overly long from subsequent edits/updates. The title wasn't accurate anymore, so I changed that as well. Also, see my answer below for a partial solution.
Here are the essential points:
Chrome goofs up like so:
- Chrome fails to free up memory allocated for MochaUI window objects when they're closed. Instead, Chrome's memory usage freezes (literally) at the level reached after the window has finished loading its iframe content, setting a lower bound on memory usage until the page is refreshed.
- Memory used by the process continues to increase with subsequent window openings/closings. Eventually, some type of cap is reached, and the memory usage stops climbing as steeply/starts to oscillate instead of jump up dramatically.
- This problem is most apparent when the windows in question are loading fairly hefty (memory-wise) iframe content. The window I'm using for all testing purposes loads a 580 kb page (uncached) in its iframe.
Strangely enough, the expected garbage collection does take place, when
- the browser is subsequently minimized
- another tab is opened in the same browser window
- a Memory Timeline is being recorded in Developer Tools. (comedy option)
- Does this behavior suggest any possible approaches to solving #1?