[TIMOB-12286] Android: Memory leak when backing out and coming back to an app
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-01-29T00:03:39.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.0.2, Release 3.1.0, 2013 Sprint 02 Core, 2013 Sprint 02 |
Components | Android |
Labels | module_memory, qe-testadded |
Reporter | Allen Yeung |
Assignee | Allen Yeung |
Created | 2013-01-15T10:33:25.000+0000 |
Updated | 2014-06-19T12:43:45.000+0000 |
Description
Steps to reproduce:
1. Run the following code:
var win = Ti.UI.createWindow({
layout: 'vertical'
});
win.buffer = Ti.createBuffer({length: 250 * 1024});
win.open();
2. Back out of the app
3. Relaunch the app
Actual Results:
If you use DDMS, you will notice that the allocated memory will increase over time if you repeat steps 2-3.
Expected Results:
The memory does not increase
When we fix this back and forth bug by creating a new context after each launch, it seems to trigger some slow behavior when loading modules at startup. This happens if you relaunch the app MANY times... like 20 or more. If we make the module use the existing context as mentioned in TIMOB-11752, this lag on startup issue should be fixed.
https://github.com/appcelerator/titanium_mobile/pull/3757
Tested with: SDK:3.1.0.v20130128172329,3.0.2.v20130128174806 Studio:3.0.2.201301251115 Device: Android emulator(v 2.3.3)
On my Samsung Galaxy Note II android 4.1.2 the is still present. Every application built with Titanium (I use 3.1.2 GA) increases his space in RAM every time it is closed (with backbutton) and, then, launched again. Demo applications like "Master/Detail Application" or "Todo List" show the same problem.