Skip to content

(Feature request) PR 173889 - Memory leaks with reading file using in WebWorks applications #67

EricLeiLi opened this Issue Jul 30, 2012 · 1 comment

1 participant

Open Source Projects member

When a file is read successfully with, 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.
: private function init(webkitControl:WebkitControl):void {
webkitControl.addEventListener(LocationChangeEvent.LOCATION_CHANGE, onPageChanged);
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 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.

Open Source Projects member

It's new feature requirement. By design, there was no requirement to free the memory because blob objects (which map to these AIR memory) should always be available if page transition doesn't happen. Will create GitHub issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.