There seems to be some kind of memory leak when moving from page to page in a WebWorks application. Some details from the community can be found in the forums.
Memory issues surrounding Java based Scriptable objects were tackled in a previous release. These seem to have a different cause.
One initial discovery is that it looks like Focus Based Navigation could be causing some of the memory issues. This could be related to its handles to the DOM through the synchronous IPC channel to WebKit.
This issue currently is not reproducible on BB5
It also seems to happen when changes are made to the DOM. This could also be one of the reasons that Focus based navigation has a role to play. Each time the DOM is changed the Focus based navigation re-indexes the nodes in the DOM.
It appears as though Focus Based Navigation was one aspect playing into this memory leak. The fact that the Java code had pointers to the DOM in WebKit made it so that WebKit would not clear the memory for the current DOM even after loading in a new page.
The new Focus Based Navigation should address this aspect of the memory leak.
Initial investigation shows that if a garbage collection is called on the Java runtime it does clean up this memory. Current approach is to try and detect low memory conditions and request a garbage collection.
Results are still to be verified.
This issue has been resolved. Details on the fix can be found here: