GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-08-23T19:05:43.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Sprint 2012-16 API, Release 3.0.0 |
Components | Android |
Labels | core, module_window, qe-testadded |
Reporter | Josh Roesslein |
Assignee | Josh Roesslein |
Created | 2012-07-23T12:50:17.000+0000 |
Updated | 2013-09-26T10:20:17.000+0000 |
When opening a window with an "url" script, the context created for this window is never
released after the window has been closed. This can lead to memory leaks if the script
kept global references to values in that context.
See the attached app.js and test.js scripts to reproduce this bug.
Create a project with both of these files in the Resources folder.
1. Run application and monitor heap with DDMS.
2. Click "Open Window".
3. Hit the back button to close the window.
4. Repeat steps 2 - 3. Watch the heap size and see if it grows.
Actual: Heap size continues to grow in size.
Expected: The memory allocated in the new context should be released
and eventually collected. Heap size should reach a ceiling and remain stable.
This is one of the causes of the memory leak seen in TIMOB-10040.
Created [PR #2720](https://github.com/appcelerator/titanium_mobile/pull/2720) to resolve issue.
Environment used for verification - Tested with Titanium SDK: 2.2.0.v20120828153312 Tested with Titanium Studio: 2.1.2.201208201549 Device - Android 2.2 emulator Machine OS - MAC 10.8