Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Memory Leak issue #47

Closed
tneil opened this issue Aug 22, 2011 · 3 comments
Closed

Memory Leak issue #47

tneil opened this issue Aug 22, 2011 · 3 comments

Comments

@tneil
Copy link
Contributor

tneil commented Aug 22, 2011

Background

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

tneil commented Oct 28, 2011

This issue has been resolved. Details on the fix can be found here:

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/PRE-RELEASE-Memory-Leak-Fix-Download/td-p/1335253

@tneil tneil closed this as completed Oct 28, 2011
dmateescu added a commit that referenced this issue Feb 21, 2012
Pull Req: Replace DIRECTION_PORTRAIT to DIRECTION_NORTH
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant