Memory Leak issue #47

tneil opened this Issue Aug 22, 2011 · 3 comments


None yet
1 participant

tneil commented Aug 22, 2011


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.


tneil commented Aug 26, 2011

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.


tneil commented Sep 5, 2011

Latest findings

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.

After trying the new Focus Based Navigation Prototype we found that there continued to be a leak where the DOM was not being released by WebKit. This looks to be triggered when a JavaScript extension uses a Callback mechanism where a handle to a JavaScript function is held in the Java runtime.

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.

tneil closed this Oct 28, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment