{ "id": "117989", "key": "TIMOB-14772", "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": [ { "id": "15691", "description": "2013 Sprint 19", "name": "2013 Sprint 19", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "15693", "description": "2013 Sprint 19 API", "name": "2013 Sprint 19 API", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-09-20T20:48:25.000+0000", "created": "2013-08-05T14:27:31.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-12-19T21:01:21.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": "h2. Problem\r\n\r\nMemory leak when removing MapView (Map Module v2)\r\n\r\nTitanium SDK 3.2.0 (HEAD)\r\nAndroid 4.2.1\r\nNexus S\r\n\r\nh2. Test case\r\nRun the app below.\r\nDump HPROF file\r\nTap on \"Toggle\" multiple times.\r\nDump HPROF file\r\nCompare memory usage of second memory dump against first one: TiUIFragement$1 and TiUIMapView do not get released, when the MapView is removed from the screen and with this the whole Google Map View is leaked (which is quite a lot of memory.)\r\n\r\n{code:lang=javascript|title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tmodal: false,\r\n\tbackgroundColor: 'white'\r\n});\r\n\t\r\nvar button = Ti.UI.createButton({\r\n\ttop: '10dp',\r\n\twidth: '100dp',\r\n\theight: '40dp',\r\n\ttitle: 'Toggle',\r\n});\r\n\t\r\nvar MapModule = require('ti.map');\r\nvar map = MapModule.createView({\r\n\ttop: '60dp',\t\r\n\tmapType:MapModule.NORMAL_TYPE\r\n});\r\n\r\nvar showingMap = true;\r\nbutton.addEventListener('click', function(evt) {\r\n\tif (showingMap) {\r\n\t\tthis.window.remove(this.map);\r\n\t} else {\r\n\t\tthis.window.add(this.map);\r\n\t}\r\n\tshowingMap = !showingMap;\t\r\n});\r\n\r\nwin.add(button);\r\nwin.add(map);\r\nwin.open();\r\n{code}", "attachment": [ { "id": "41310", "filename": "after-5-toggles.hprof.zip", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-08-06T06:39:09.000+0000", "size": 2856601, "mimeType": "application/zip" }, { "id": "41307", "filename": "before-baseline.hprof.zip", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-08-06T06:39:09.000+0000", "size": 2146222, "mimeType": "application/zip" }, { "id": "41306", "filename": "log.txt", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-08-06T06:39:09.000+0000", "size": 18412, "mimeType": "text/plain" }, { "id": "41308", "filename": "Screen Shot 2013-08-06 at 08.30.03.png", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-08-06T06:39:09.000+0000", "size": 21311, "mimeType": "image/png" }, { "id": "41309", "filename": "Screen Shot 2013-08-06 at 08.30.23.png", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-08-06T06:39:09.000+0000", "size": 105624, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Memory leak when removing MapView (Google Maps module v2)", "creator": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "264924", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "body": "I could resolve this memory leak by adding the following to TiUIFragment:\n\n{code}\n@Override\npublic void release()\n{\n FragmentTransaction transaction = manager.beginTransaction();\n transaction.remove(fragment);\n transaction.commit();\n super.release();\n}\n{code}\n\nAnd adding a call to \"super.release()\" at the end of \"release()\" in TiUIMapView.\n\n", "updateAuthor": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-08-05T14:31:10.000+0000", "updated": "2013-08-05T14:31:10.000+0000" }, { "id": "264940", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hi [~philet],\n\nThanks for bring it up to our attention.\n\nCan you please provide either device or console output logs? Make sure to fill out reports according [Jira checklist|http://docs.appcelerator.com/titanium/latest/#!/guide/How_to_Submit_a_Bug_Report-section-29004732_HowtoSubmitaBugReport-JIRATicketChecklist] so we are able to diagnose issues quicker. Also, would be great if you can share HPROF summary or screenshots to have a wider insight around this. Thanks.", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-05T16:42:54.000+0000", "updated": "2013-08-05T16:42:54.000+0000" }, { "id": "265068", "author": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi Eduardo\r\n\r\nI have attached the log, 2 HPROF files as well as 2 screenshots containing the comparison of the 2 HPROF files.\r\n\r\nThanks for looking into this.\r\n\r\nRegards,\r\nPhilippe\r\n\r\n", "updateAuthor": { "name": "philet", "key": "philet", "displayName": "Philippe Wueger", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-08-06T06:39:09.000+0000", "updated": "2013-08-06T06:39:09.000+0000" }, { "id": "265203", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-08-06T21:17:15.000+0000", "updated": "2013-08-06T21:17:15.000+0000" }, { "id": "272036", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Master PR: https://github.com/appcelerator/titanium_mobile/pull/4718 + https://github.com/appcelerator-modules/ti.map/pull/12", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-19T22:33:25.000+0000", "updated": "2013-09-19T23:49:07.000+0000" }, { "id": "285247", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix by running the sample code & grabbing the hprof dumps before and after toggling the maps. Did not find any leaks.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppcel Studio : 3.2.0.201312181652\r\nTi SDK : 3.2.0.v20131218153242\r\nMac OSX : 10.8.5\r\nAlloy : 1.3.0-cr2\t\r\nCLI - 3.2.0-cr3\r\nSamsung Galaxy S4 running android 4.2.2", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-19T21:01:21.000+0000", "updated": "2013-12-19T21:01:21.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }