{ "id": "131219", "key": "AC-1559", "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": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2014-06-30T02:00:28.000+0000", "created": "2014-06-04T02:52:37.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:38:01.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": "Hi,\r\nWe created app for Sales&Inventory Management System. This app having more no of screens so we used Multiple Windows concepts. our app working perfectly But we have MEMORY issue. Whenever i open the new window the Memory size was increased After Closed window i clear all the children's components & put 'null'. Device HEAP Memory size is not reduced. I have used below functions for clear children’s:\r\n\r\n.\r\n.\r\n.\r\nwindowClosed : function(){\r\n Controller.prototype. deAllocate(win);\r\n \r\n},\r\ndeAllocate : function(win) {\r\n \r\n var length = win.children.length;\r\n for (var ctr = length-1; ctr >= 0; ct--) {\r\n var childView = view.children[ctr];\r\n if (childView != undefined || childView != null) {\r\n Ti.API.info(‘deAllocate -> ‘ + childView);\r\n Controller.prototype.deAllocateChildView(childView);\r\n win.remove(childView);\r\n childView = null;\r\n }\r\n childView = null;\r\n }\r\n win.close();\r\n win = null;\r\n},\r\ndeAllocateChildView : function(view){\r\n var length = view.children.length;\r\n \r\n for (var ctr = length-1; ctr >= 0; ctr--) {\r\n var childView = view.children[ctr];\r\n if (childView != undefined || childView != null) {\r\n Ti.API.info(‘deAllocateChildView -> ‘ + childView);\r\n Controller.prototype.deAllocateChildView(childView);\r\n view.remove(childView);\r\n childView = null;\r\n }\r\n childView = null;\r\n }\r\n view = null;\r\n},\r\n.\r\n.\r\n.\r\n\r\nI checked with logcat all the UI components are removed. but heap memory size is not reduced. whenever i opened new window the heap memory size is increasing. Once its reached 48MB my app will through OUT OF MEMORY exception is coming and app EXIT we need to restart the app.\r\n\r\nmy TiApp.xml file:\r\n\r\n\r\n 41943040\r\n 41943040\r\n 17\r\n distribution\r\n true\r\n dp\r\n false\r\n true\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\nIs there any way to reduce heap memory, can you help me to fix this problem…\r\n\r\nThanks\r\n", "attachment": [], "flagged": false, "summary": "How to Reduce/Clear Android Heap Memory Size???", "creator": { "name": "rksattanathan@gmail.com", "key": "rksattanathan@gmail.com", "displayName": "Sattanathan", "active": true, "timeZone": "Asia/Shanghai" }, "subtasks": [], "reporter": { "name": "rksattanathan@gmail.com", "key": "rksattanathan@gmail.com", "displayName": "Sattanathan", "active": true, "timeZone": "Asia/Shanghai" }, "environment": "Titanium SDK 3.1.3.GA\r\nMac : OS X Version 10.9\r\nPlatform : Android OS", "comment": { "comments": [ { "id": "311537", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "Hello!\r\n\r\nAll the memory is managed by Android. In short:\r\n\r\nIt will keep memory assigned to your app (even if you do this nice cleaning), since it will use both CPU and battery to do so. What it does is, it leaves the memory untouched, until the memory is needed. \r\n\r\nMore info about this, here; \r\n\r\nhttp://forum.xda-developers.com/showthread.php?t=897823\r\n\r\nBest Regards!", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2014-06-30T02:00:28.000+0000", "updated": "2014-06-30T02:00:28.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }