You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 4, 2019. It is now read-only.
When a file is read successfully with blackberry.io.file.readFile(), a Blob is returned. This Blob is stored in AIR until a location change event is fired.
However, most WebWorks applications (e.g. bbUI.js or jQuery Mobile) are single page which dynamically load/unload DIVs. Thus, the location change event is NOT fired (e.g. window.location is always index.html) and hence those Blobs are never released in memory until the application closes.
In https://github.com/blackberry/WebWorks-TabletOS/blob/master/framework/src/webworks/service/blob/BlobManager.as
: private function init(webkitControl:WebkitControl):void {
webkitControl.addEventListener(LocationChangeEvent.LOCATION_CHANGE, onPageChanged);
initRepository();
}
private function onPageChanged():void {
//Dump the old blob repository when we go to a new page to avoid memory leaks
initRepository(); } In above, you can see memory leak will occur until a
LocationChangeEvent.LOCATION_CHANGE Is dispatched. Is there a way to free a
Blob explicitly other than a LocationChangeEvent.LOCATION_CHANGE? Is there a
way to send this event other than changing the window.location for real?
Steps to Reproduce: In a simple 1-page WebWorks application, continue to use
blackberry.io.file.readFile() on the same file again and again. Even though
Javascript references to the Blob is made null, memory keeps increasing until
the application closes.
Expected Results: There should be a way other than a location change event to
free the memory used in Blobs.
Actual Results: Memory keeps increasing until the application closes.