{ "id": "84645", "key": "AC-3034", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-01-10T08:32:26.000+0000", "created": "2012-01-10T08:11:55.000+0000", "labels": [ "android", "crash", "feature", "ios" ], "versions": [], "issuelinks": [], "assignee": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "updated": "2016-03-08T07:48:04.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "As our application uses quite some images for its visual representation, we started to run into memory issues on Android once we introduced different layouts.\r\n\r\nRelevant snippets from LogCat:\r\n{code}\r\n01-05 10:45:35.285: E/AndroidRuntime(460): FATAL EXCEPTION: main\r\n01-05 10:45:35.285: E/AndroidRuntime(460): java.lang.OutOfMemoryError: bitmap size exceeds VM budget\r\n01-05 10:45:35.285: E/AndroidRuntime(460): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)\r\n01-05 10:45:35.285: E/AndroidRuntime(460): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:459)\r\n{code}\r\n\r\nA possible solution would be to manually load images and assign them to the views' backgrounds directly, like this:\r\n\r\n{code}\r\nvar group;\r\nvar win;\r\nvar tab;\r\nvar view;\r\n\r\n\r\nTitanium.UI.setBackgroundColor('#000');\r\ngroup = Titanium.UI.createTabGroup();\r\nwin = Titanium.UI.createWindow({\r\n backgroundColor:'#fff',\r\n title: 'Test'\r\n});\r\ntab = Titanium.UI.createTab({\r\n icon: 'KS_nav_views.png',\r\n title: win.title,\r\n window: win\r\n});\r\nvar img = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory + '/KS_nav_ui.png').read().image;\r\nview = Titanium.UI.createView({\r\n\tbackgroundImage: img\r\n});\r\nwin.add(view);\r\ngroup.addTab(tab);\r\n\r\n\r\ngroup.open();\r\n{code}\r\n\r\nHowever, this doesn't work with Titanium's current implementation (no background on Android; Crash on iOS -- shouldn't this rather be an exception than a crash?). Due to TC-550, using Ti.UI.ImageView isn't an option either.", "attachment": [], "flagged": false, "summary": "Using lots of graphics drastically increases VM memory footprint on Android", "creator": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Mac OS X 10.6.8\r\nJava 1.6.0_29\r\nTitanium Studio 1.0.7.201112281340\r\nTitanium Mobile 1.7.6 and 1.8.0.1\r\nAndroid SDK 2.2 (API 8)", "comment": { "comments": [ { "id": "178661", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-10T08:32:14.000+0000", "updated": "2012-01-10T08:32:14.000+0000" }, { "id": "178669", "author": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "So, given that I want to improve the way the memory is managed and you simply provide a link to a document which doesn't solve my problem, should I go away from Titanium and instead develop app natively, so I can at least improve the way the memory is managed?", "updateAuthor": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-01-10T08:51:57.000+0000", "updated": "2012-01-10T08:51:57.000+0000" }, { "id": "178670", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "Also, see the overviews in [this section|https://wiki.appcelerator.org/display/guides/Cross-Platform+Mobile+Development+In+Titanium] of the \"Building Mobile Applications with Titanium\" book.", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-10T08:51:57.000+0000", "updated": "2012-01-10T08:51:57.000+0000" }, { "id": "178672", "author": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "None of these overviews bring me closer to improving the memory footprint of the application.", "updateAuthor": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-01-10T08:57:49.000+0000", "updated": "2012-01-10T08:57:49.000+0000" }, { "id": "178681", "author": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "body": "A ticket needs to prove the existence of a bug, for it to be accepted. I'm afraid that this does not, in its current form. Please kindly refer to the [How to Submit a Bug Report|https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report] guide to learn how tickets need to be filed. Please also remember to raise a [Q&A question|http://developer.appcelerator.com/questions/created] (and to allow time for people to respond) before opening a ticket.\r\n\r\nThank you", "updateAuthor": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "created": "2012-01-10T09:27:47.000+0000", "updated": "2012-01-10T09:27:47.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }