Hi All,
I use Titanium SDK 3.1.3.GA. When I run my app on the Android device the HEAP Memory not reduced. I cleared all the children’s after window closed. I have used below functions for clear children’s:
. . . windowClosed : function(){ Controller.prototype. deAllocate(win); }, deAllocate : function(win) { var length = win.children.length; for (var ctr = length-1; ctr >= 0; ct- -) { var childView = view.children[ctr]; if (childView != undefined || childView != null) { Ti.API.info(‘deAllocate -> ‘ + childView); Controller.prototype.deAllocateChildView(childView); win.remove(childView); childView = null; } childView = null; } win.close(); win = null; }, deAllocateChildView : function(view){ var length = view.children.length; for (var ctr = length-1; ctr >= 0; ctr- -) { var childView = view.children[ctr]; if (childView != undefined || childView != null) { Ti.API.info(‘deAllocateChildView -> ‘ + childView); Controller.prototype.deAllocateChildView(childView); view.remove(childView); childView = null; } childView = null; } view = null; }, . . .I checked with logcat all the UI components are removed. but heap memory size if 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 and EXIT.
my TiApp.xml file:
<android xmlns:android="http://schemas.android.com/apk/res/android"> <property name="ti.android.threadstacksize" type="int">41943040</property> <property name="ti.android.httpclient.maxbuffersize" type="int">41943040</property> <tool-api-level>17</tool-api-level> <property name="ti.deploytype">distribution</property> <property name="ti.android.compilejs" type="bool">true</property> <property name="ti.ui.defaultunit">dp</property> <property name="ti.android.root.reappears.restart" type="bool">false</property> <property name="ti.android.bug2373.finishfalseroot" type="bool">true</property> <manifest android:installLocation="preferExternal"> <uses-sdk android:minSdkVersion="15"/> <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/> </manifest> <application android:allowTaskReparenting="true" android:debuggable="true" android:enabled="true" android:hardwareAccelerated="true" android:hasCode="true" android:killAfterRestore="true" android:label="AppLeak" android:largeHeap="true" android:name="AppleakApplication" android:persistent="true" android:restoreAnyVersion="true" android:supportsRtl="true"> <uses-library android:name="com.google.android.maps"/> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/> <uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> </application> </android>Is there any way to reduce heap memory, someone can help me…
Thanks