{ "id": "159404", "key": "TIMOB-23218", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2019-11-19T18:48:40.000+0000", "created": "2016-04-08T06:06:38.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Android", "Android5", "Android6.0", "ImageView", "OutOfMemory", "engTriage", "toBlob" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2019-11-19T18:48:40.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "I got OutOfMemory with this code.\r\n\r\nSteps to reproduce:\r\n1. Create default Alloy project\r\n2. Load and save big image to the assets\r\n3. Add this test code to the click event handler\r\n4. Click several times to the view with click event attached\r\n5. See result in log\r\n\r\nImage: https://static.pexels.com/photos/479/landscape-nature-sunset-trees.jpg\r\n\r\n{code:javascript|title=test code}\r\nvar iv = Ti.UI.createImageView({\r\n\twidth : Ti.UI.SIZE,\r\n\theight : Ti.UI.SIZE,\r\n\timage : '/images/landscape-nature-sunset-trees.jpg'\r\n});\r\nvar blob = iv.toBlob();\r\niv.image = null;\r\niv = null;\r\nTi.API.info('OK!');\r\n{code}\r\n\r\n\r\n{code:text|title=error log}\r\n[ERROR] TiDrawableReference: (KrollRuntimeThread) [6078,6078] Unable to load bitmap. Not enough memory: Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM\r\n[ERROR] TiDrawableReference: java.lang.OutOfMemoryError: Failed to allocate a 23887884 byte allocation with 8219096 free bytes and 7MB until OOM\r\n[ERROR] TiDrawableReference: \tat dalvik.system.VMRuntime.newNonMovableArray(Native Method)\r\n[ERROR] TiDrawableReference: \tat android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)\r\n[ERROR] TiDrawableReference: \tat android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:609)\r\n[ERROR] TiDrawableReference: \tat org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:348)\r\n[ERROR] TiDrawableReference: \tat org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:300)\r\n[ERROR] TiDrawableReference: \tat ti.modules.titanium.ui.widget.TiUIImageView.toBlob(TiUIImageView.java:947)\r\n[ERROR] TiDrawableReference: \tat ti.modules.titanium.ui.ImageViewProxy.toBlob(ImageViewProxy.java:93)\r\n[ERROR] TiDrawableReference: \tat org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)\r\n[ERROR] TiDrawableReference: \tat org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)\r\n[ERROR] TiDrawableReference: \tat org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:918)\r\n[ERROR] TiDrawableReference: \tat org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1141)\r\n[ERROR] TiDrawableReference: \tat org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:356)\r\n[ERROR] TiDrawableReference: \tat android.os.Handler.dispatchMessage(Handler.java:98)\r\n[ERROR] TiDrawableReference: \tat android.os.Looper.loop(Looper.java:148)\r\n[ERROR] TiDrawableReference: \tat org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118)\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: OutOfMemoryError in ImageView.toBlob", "creator": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "subtasks": [], "reporter": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "environment": "Genymotion 5.1/6.0, Ti SDK 5.2.1.GA/5.4.0", "comment": { "comments": [ { "id": "382255", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nI am unable to reproduce this issue on Nexus 7 using the sample code and given steps. I tried with sdk 5.2.2.GA and 5.4.0 but got same result. I used the given image for testing. My index.js file is as follows.\r\n{code}\r\nfunction doClick(e) {\r\n\tTi.API.info('Starting...');\r\n\tvar iv = Ti.UI.createImageView({\r\n\r\n\t\twidth : Ti.UI.SIZE,\r\n\r\n\t\theight : Ti.UI.SIZE,\r\n\r\n\t\timage : '/images/landscape-nature-sunset-trees.jpg'\r\n\r\n\t});\r\n\r\n\tvar blob = iv.toBlob();\r\n\r\n\tiv.image = null;\r\n\r\n\tiv = null;\r\n\t\r\n\r\n\tTi.API.info('OK!');\r\n\r\n}\r\n\r\n$.index.open();\r\n\r\n{code} \r\n\r\nAfter building the app when I clicked the view several times at once the following console log is produced.\r\n\r\n*Console Log:*\r\n{code}\r\n[INFO] : Starting...\r\n[INFO] : OK!\r\n[INFO] : Starting...\r\n[WARN] : art: Suspending all threads took: 5.523ms\r\n[INFO] : art: Background partial concurrent mark sweep GC freed 49(9KB) AllocSpace objects, 2(12MB) LOS objects, 16% free, 80MB/96MB, paused 6.286ms total 26.184ms\r\n[INFO] : OK!\r\n[INFO] : Starting...\r\n[INFO] : OK!\r\n[INFO] : Starting...\r\n[INFO] : OK!\r\n[INFO] : Starting...\r\n[INFO] : OK!\r\n[INFO] : Starting...\r\n[WARN] : art: Suspending all threads took: 19.805ms\r\n[INFO] : art: Background partial concurrent mark sweep GC freed 29(9KB) AllocSpace objects, 4(12MB) LOS objects, 12% free, 109MB/125MB, paused 20.721ms total 40.740ms\r\n[INFO] : OK!\r\n{code}\r\n\r\n*Environment*:\r\n\r\n*Device info:* Nexux7 (android 6.0.1)\r\n*Node.js Version:* 0.12.7\r\n*npm Version:* 2.11.3\r\n*Titanium SDKs:* 5.2.2.GA and 5.2.1.GA\r\n*Java Development Kit Version:* 1.8.0_73\r\n*Titanium CLI Version:* 5.0.5\r\n*Appcelerator CLI Version:* 5.2.2\r\n*Appcelerator Studio:* 4.4.0.201511241829\r\n", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-04-10T08:36:48.000+0000", "updated": "2016-04-18T00:59:35.000+0000" }, { "id": "382803", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "Can be reviewed?", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2016-04-15T06:29:22.000+0000", "updated": "2016-04-15T06:29:22.000+0000" }, { "id": "382971", "author": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "body": "@Nazmus Salahin can you try in genymotion emulator?", "updateAuthor": { "name": "falko", "key": "falko", "displayName": "Andrey Tkachenko", "active": true, "timeZone": "Europe/Moscow" }, "created": "2016-04-18T12:34:50.000+0000", "updated": "2016-04-18T12:34:50.000+0000" }, { "id": "437980", "author": { "name": "john.staunton", "key": "john.staunton", "displayName": "John Staunton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I get the same thing in Genymotion emulator and on pretty much any x86 device (tried 3 different ones)", "updateAuthor": { "name": "john.staunton", "key": "john.staunton", "displayName": "John Staunton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-05-29T10:36:52.000+0000", "updated": "2018-05-29T10:36:52.000+0000" }, { "id": "452791", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing issue as “Cannot Reproduce”. Although the URL links is no longer available we tested with a large image.\r\n\r\nAxway Appcelerator Studio, build: 5.1.4.201909061933 \r\nmacOS : 10.15\r\nNode.js Version : 8.9.1\r\nnpm Version : 5.5.1\r\nAppcelerator CLI : 7.1.1\r\nTitanium CLI\r\nCLI Version : 5.2.1\r\nnode-appc Version : 0.2.49\r\nTitanium SDKs : 8.2.1.GA", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-19T18:48:40.000+0000", "updated": "2019-11-19T18:48:40.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }