Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12286] Android: Memory leak when backing out and coming back to an app

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-01-29T00:03:39.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.2, Release 3.1.0, 2013 Sprint 02 Core, 2013 Sprint 02
ComponentsAndroid
Labelsmodule_memory, qe-testadded
ReporterAllen Yeung
AssigneeAllen Yeung
Created2013-01-15T10:33:25.000+0000
Updated2014-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

Comments

  1. Allen Yeung 2013-01-15

    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.
  2. Allen Yeung 2013-01-23

    https://github.com/appcelerator/titanium_mobile/pull/3757
  3. Anshu Mittal 2013-01-29

    Tested with: SDK:3.1.0.v20130128172329,3.0.2.v20130128174806 Studio:3.0.2.201301251115 Device: Android emulator(v 2.3.3)
  4. Luca Marzi 2013-09-04

    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.

JSON Source