Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15439] Android: App crashes with just a few ImageViews

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-10-28T22:55:39.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 22, 2013 Sprint 22 Core
ComponentsAndroid
Labelsregression
ReporterDavide Cassenti
AssigneeAllen Yeung
Created2013-10-09T13:02:50.000+0000
Updated2017-03-21T22:34:00.000+0000

Description

Description of the problem

When there are few ImageViews in the app, if the image is big, the Emulator crashes with an 'out-of-memory' error. Images in the test is 280KB and is added 5 times to the app.

Steps to reproduce

Use the attached image, and the following code:
var win = Ti.UI.createWindow({
	backgroundColor: 'black'
});

function createImageView() {
	var iv = Ti.UI.createImageView({
		backgroundImage: '/background_main.png'
	});
	
	return iv;
}

for (var i=0; i<5; i++) {
	win.add(createImageView());
}

win.open();

Note

Running this on Nexus 4 with Android 4.3.3 works fine; same using SDK 3.1.2. Before the crash, the heap size increases up to ~48MB and then the app exits.

Attachments

FileDateSize
background_main.png2013-10-09T13:04:11.000+0000286070
timob-15439-3.1.2.txt2013-10-24T17:09:51.000+0000579
timob-15439-3.1.3.txt2013-10-24T17:09:51.000+000019036

Comments

  1. Ingo Muschenetz 2013-10-09

    [~dcassenti] to confirm: * 3.1.2 + all Android devices => no problem * 3.1.3 + Android 4.2.2 => crash * 3.1.3 + Android 4.3.3 => no problem Is this correct?
  2. Ingo Muschenetz 2013-10-09

    I added the two ImageView tickets fixed in 3.1.3. Either of those look like culprits?
  3. Davide Cassenti 2013-10-24

    Attaching logs coming from Android Emulator 4.2.2 with SDK 3.1.2 vs 3.1.3 The heap grows drastically with 3.1.3, while is fine in 3.1.2
  4. Allen Yeung 2013-10-28

    I could not reproduce this on the latest master branch. I tried on a 4.2.2 emulator, and a 4.2.2 device. From the logs, this looks like it is fast dev related. If that is the case, it will not exist in the latest master build since we don't support fastdev with the new Android Build command. Please refer to TIMOB-15519 on the fastdev deprecation status.
  5. Lee Morris 2017-03-21

    Closing ticket as the issue cannot be reproduced and due to the above comments.

JSON Source