{ "id": "103466", "key": "TIMOB-11671", "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": "16270", "description": "2014 Sprint 10", "name": "2014 Sprint 10", "archived": true, "released": true, "releaseDate": "2014-05-22" }, { "id": "16271", "description": "2014 Sprint 10 SDK", "name": "2014 Sprint 10 SDK", "archived": true, "released": true, "releaseDate": "2014-05-22" }, { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-06-12T17:15:44.000+0000", "created": "2012-10-16T07:01:37.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "community", "module_network", "parity", "qe-closed-3.3.0", "qe-manualtest" ], "versions": [ { "id": "14137", "description": "Release 2.1.3", "name": "Release 2.1.3", "archived": true, "released": true, "releaseDate": "2012-10-03" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "31351", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "119117", "key": "MOD-1507", "fields": { "summary": "SyncServer: Memory leak on Android", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "38400", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "131730", "key": "TIMOB-17162", "fields": { "summary": "Android: TiHTTPClient.getResponseHeader throws NullPointerException", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "30084", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "116883", "key": "TIMOB-14486", "fields": { "summary": "Android: TiHTTPClient memory leaks and holds request/response values with sensitive information", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-08-06T20:45:00.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": "h6.Problem\r\nAttached is an example application to demonstrate memory leak by Http Client.\r\n\r\nMaking multiple webservice call but still heap memory keep on increasing and app leads to \"Out Of Memory Exception\" if heap memory exceeds size limit leading app to potentially crash.\r\n\r\nMonitoring app through out iOS Instruments revealed no HTTP Client objects remain stacked up in memory.\r\n\r\nh6.Steps to reproduce\r\nThe following steps attempt to demonstrate the issue with suds.js sample.\r\n\r\n1. Run sample code\r\n2. Click on \"Start Web Service Call\" Button.\r\n3. App starts making multiple requests using http client suds.js\r\n4. Start analysing Deprecated Logcat and filter with the keyword \"Heap\" as provided the screen shot at the jira ticket.\r\n5. Once app Heap memory crosses certain limit you will see whether an error or crash on the app screen Location: suds.js \r\n6. Analyses the error using log cat : Out of Memory Exception. Try repeating the above steps more than once, you will see the error.\r\n\r\nh6.Stack trace\r\nDroid Razr 2.3.5 OS\r\n\r\nh6.1st run\r\n{code}\r\n11-05 16:14:12.964: I/dalvikvm-heap(4781): Grow heap (frag case) to 15.250MB for 1554748-byte allocation\r\n11-05 16:14:13.058: I/dalvikvm-heap(4781): Grow heap (frag case) to 16.715MB for 1351190-byte allocation\r\n11-05 16:14:21.035: I/dalvikvm-heap(4781): Grow heap (frag case) to 17.131MB for 1175574-byte allocation\r\n11-05 16:14:54.988: I/dalvikvm-heap(4781): Grow heap (frag case) to 15.909MB for 3707168-byte allocation\r\n11-05 16:14:55.097: I/dalvikvm-heap(4781): Grow heap (frag case) to 16.792MB for 2780384-byte allocation\r\n11-05 16:14:55.222: I/dalvikvm-heap(4781): Grow heap (frag case) to 14.583MB for 2780384-byte allocation\r\n11-05 16:14:56.097: I/dalvikvm-heap(4781): Grow heap (frag case) to 18.973MB for 2719000-byte allocation\r\n11-05 16:14:56.199: I/dalvikvm-heap(4781): Grow heap (frag case) to 21.133MB for 4078496-byte allocation\r\n11-05 16:14:56.277: I/dalvikvm-heap(4781): Grow heap (frag case) to 21.186MB for 2777424-byte allocation\r\n11-05 16:15:45.222: I/dalvikvm(2526): dvmDdmHandleHpsgChunk(when 1, what 0, heap 0)\r\n11-05 16:15:53.863: D/ddm-heap(2526): Heap GC request\r\n11-05 16:18:04.747: I/dalvikvm-heap(4781): Grow heap (frag case) to 16.023MB for 3707168-byte allocation\r\n11-05 16:18:04.856: I/dalvikvm-heap(4781): Grow heap (frag case) to 16.907MB for 2780384-byte allocation\r\n11-05 16:18:04.981: I/dalvikvm-heap(4781): Grow heap (frag case) to 14.697MB for 2780384-byte allocation\r\n11-05 16:18:05.849: I/dalvikvm-heap(4781): Grow heap (frag case) to 19.086MB for 2719000-byte allocation\r\n11-05 16:18:05.942: I/dalvikvm-heap(4781): Grow heap (frag case) to 21.247MB for 4078496-byte allocation\r\n11-05 16:18:06.044: I/dalvikvm-heap(4781): Grow heap (frag case) to 21.299MB for 2777424-byte allocation\r\n11-05 16:18:06.419: D/GraphicsJNI(4781): Waiting for heap walker to free more memory\r\n11-05 16:18:06.442: D/GraphicsJNI(4781): Heap walker done, retry to allocate\r\n11-05 16:18:07.177: I/dalvikvm-heap(499): Grow heap (frag case) to 21.693MB for 60840-byte allocation\r\n11-05 16:18:07.356: I/dalvikvm-heap(499): Grow heap (frag case) to 19.512MB for 121664-byte allocation\r\n11-05 16:18:07.513: I/dalvikvm-heap(499): Grow heap (frag case) to 19.571MB for 60840-byte allocation\r\n{code}\r\n\r\nh6.2nd run\r\n{code}\r\n11-05 16:29:50.856: I/dalvikvm(6859): dvmDdmHandleHpsgChunk(when 1, what 0, heap 0)\r\n11-05 16:29:55.981: D/ddm-heap(6859): Heap GC request\r\n11-05 16:30:08.481: I/dalvikvm-heap(6859): Grow heap (frag case) to 9.940MB for 668897-byte allocation\r\n11-05 16:30:08.638: I/dalvikvm-heap(6859): Grow heap (frag case) to 10.571MB for 668897-byte allocation\r\n11-05 16:30:08.763: I/dalvikvm-heap(6859): Grow heap (frag case) to 11.208MB for 891856-byte allocation\r\n11-05 16:30:08.872: I/dalvikvm-heap(6859): Grow heap (frag case) to 11.634MB for 445936-byte allocation\r\n11-05 16:30:08.997: I/dalvikvm-heap(6859): Grow heap (frag case) to 12.511MB for 1783696-byte allocation\r\n11-05 16:30:09.114: I/dalvikvm-heap(6859): Grow heap (frag case) to 13.362MB for 891856-byte allocation\r\n11-05 16:30:09.935: I/dalvikvm-heap(6859): Grow heap (frag case) to 14.082MB for 1357688-byte allocation\r\n11-05 16:30:17.200: I/dalvikvm-heap(6859): Grow heap (frag case) to 15.623MB for 760710-byte allocation\r\n11-05 16:31:06.060: I/dalvikvm-heap(6859): Grow heap (frag case) to 15.256MB for 1554748-byte allocation\r\n11-05 16:31:10.419: D/ddm-heap(6859): Heap GC request\r\n11-05 16:31:23.341: D/ddm-heap(6859): Heap GC request\r\n11-05 16:31:31.669: I/dalvikvm-heap(6859): Grow heap (frag case) to 15.923MB for 3707168-byte allocation\r\n11-05 16:31:31.856: I/dalvikvm-heap(6859): Grow heap (frag case) to 16.807MB for 2780384-byte allocation\r\n11-05 16:31:32.052: I/dalvikvm-heap(6859): Grow heap (frag case) to 14.597MB for 2780384-byte allocation\r\n11-05 16:31:33.091: I/dalvikvm-heap(6859): Grow heap (frag case) to 18.987MB for 2719000-byte allocation\r\n11-05 16:31:33.271: I/dalvikvm-heap(6859): Grow heap (frag case) to 21.147MB for 4078496-byte allocation\r\n11-05 16:31:33.442: I/dalvikvm-heap(6859): Grow heap (frag case) to 21.201MB for 2777424-byte allocation\r\n{code}\r\n\r\nh6.3rd run\r\n{code}\r\n11-05 16:50:45.906: E/dalvikvm-heap(8253): Out of memory on a 1024256-byte allocation.\r\n11-05 16:50:45.906: I/dalvikvm(8253): \"KrollRuntimeThread\" prio=5 tid=10 RUNNABLE\r\n11-05 16:50:45.906: I/dalvikvm(8253): | group=\"main\" sCount=0 dsCount=0 obj=0x405a6480 self=0x2dc020\r\n11-05 16:50:45.906: I/dalvikvm(8253): | sysTid=8263 nice=0 sched=0/0 cgrp=default handle=2998616\r\n11-05 16:50:45.906: I/dalvikvm(8253): | schedstat=( 81520599501 5353912207 33230 )\r\n11-05 16:50:45.906: I/dalvikvm(8253): at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:~95)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:153)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at java.lang.StringBuilder.append(StringBuilder.java:217)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at ti.modules.titanium.xml.ElementProxy.getTextImpl(ElementProxy.java:59)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at ti.modules.titanium.xml.ElementProxy.getTextImpl(ElementProxy.java:64)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at ti.modules.titanium.xml.ElementProxy.getTextContent(ElementProxy.java:47)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at ti.modules.titanium.xml.ElementProxy.getText(ElementProxy.java:40)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:63)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:869)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at android.os.Handler.dispatchMessage(Handler.java:95)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at android.os.Looper.loop(Looper.java:130)\r\n11-05 16:50:45.906: I/dalvikvm(8253): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)\r\n11-05 16:50:45.914: W/System.err(8253): java.lang.OutOfMemoryError\r\n11-05 16:50:45.914: W/System.err(8253): \tat java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:95)\r\n11-05 16:50:45.914: W/System.err(8253): \tat java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:153)\r\n11-05 16:50:45.914: W/System.err(8253): \tat java.lang.StringBuilder.append(StringBuilder.java:217)\r\n11-05 16:50:45.914: W/System.err(8253): \tat ti.modules.titanium.xml.ElementProxy.getTextImpl(ElementProxy.java:59)\r\n11-05 16:50:45.914: W/System.err(8253): \tat ti.modules.titanium.xml.ElementProxy.getTextImpl(ElementProxy.java:64)\r\n11-05 16:50:45.914: W/System.err(8253): \tat ti.modules.titanium.xml.ElementProxy.getTextContent(ElementProxy.java:47)\r\n11-05 16:50:45.914: W/System.err(8253): \tat ti.modules.titanium.xml.ElementProxy.getText(ElementProxy.java:40)\r\n11-05 16:50:45.914: W/System.err(8253): \tat org.appcelerator.kroll.runtime.v8.V8Object.nativeCallProperty(Native Method)\r\n11-05 16:50:45.914: W/System.err(8253): \tat org.appcelerator.kroll.runtime.v8.V8Object.callProperty(V8Object.java:63)\r\n11-05 16:50:45.914: W/System.err(8253): \tat org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:869)\r\n11-05 16:50:45.914: W/System.err(8253): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\n11-05 16:50:45.914: W/System.err(8253): \tat android.os.Looper.loop(Looper.java:130)\r\n11-05 16:50:45.914: W/System.err(8253): \tat org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112)\r\n11-05 16:50:45.914: I/DEBUG(9126): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\r\n11-05 16:50:45.914: I/DEBUG(9126): Build fingerprint: 'verizon/spyder_vzw/cdma_spyder:2.3.5/6.5.1-73_DHD-11_M1-2/111130:user/release-keys'\r\n11-05 16:50:45.914: I/DEBUG(9126): pid: 8253, tid: 8263 >>> com.appc.test <<<\r\n11-05 16:50:45.914: I/DEBUG(9126): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000\r\n11-05 16:50:45.914: I/DEBUG(9126): tls: 44e14f00\r\n11-05 16:50:45.914: I/DEBUG(9126): r0 002cc168 r1 44e14ac7 r2 00000008 r3 00000001\r\n11-05 16:50:45.914: I/DEBUG(9126): r4 8253f1e0 r5 00001e40 r6 00000000 r7 00000000\r\n11-05 16:50:45.914: I/DEBUG(9126): r8 44e14ac7 r9 00000000 10 002fd964 fp 405ed750\r\n11-05 16:50:45.914: I/DEBUG(9126): ip 8253f2c0 sp 44e14a58 lr 8213cf24 pc 8213cf90 cpsr 60000010\r\n11-05 16:50:45.914: I/DEBUG(9126): d0 0074006e00750052 d1 002e0065006d0069\r\n11-05 16:50:45.914: I/DEBUG(9126): d2 006100760061006a d3 003200310031003a\r\n11-05 16:50:45.914: I/DEBUG(9126): d4 480c34d6014dfc48 d5 4069000000000000\r\n11-05 16:50:45.914: I/DEBUG(9126): d6 0000960100000000 d7 0000960100000000\r\n11-05 16:50:45.914: I/DEBUG(9126): d8 0000000041880000 d9 0000000000000000\r\n11-05 16:50:45.914: I/DEBUG(9126): d10 0000000000000000 d11 0000000000000000\r\n11-05 16:50:45.914: I/DEBUG(9126): d12 0000000000000000 d13 0000000000000000\r\n11-05 16:50:45.914: I/DEBUG(9126): d14 0000000000000000 d15 0000000000000000\r\n11-05 16:50:45.914: I/DEBUG(9126): d16 0000000700000000 d17 0000000000000000\r\n11-05 16:50:45.914: I/DEBUG(9126): d18 4042800000000000 d19 0000000000000000\r\n11-05 16:50:45.914: I/DEBUG(9126): d20 3ff0000000000000 d21 8000000000000000\r\n11-05 16:50:45.922: I/DEBUG(9126): d22 c042800000000000 d23 0b00000000000000\r\n11-05 16:50:45.922: I/DEBUG(9126): d24 0800000000000000 d25 0c00000000000000\r\n11-05 16:50:45.922: I/DEBUG(9126): d26 0100010001000100 d27 0100010001000100\r\n11-05 16:50:45.922: I/DEBUG(9126): d28 0100010001000100 d29 3ff0000000000000\r\n11-05 16:50:45.922: I/DEBUG(9126): d30 0000000000000000 d31 3ff0000000000000\r\n11-05 16:50:45.922: I/DEBUG(9126): scr 60000013\r\n11-05 16:50:45.968: I/DEBUG(9126): #00 pc 0013cf90 /data/data/com.appc.test/lib/libkroll-v8.so\r\n11-05 16:50:45.968: I/DEBUG(9126): #01 lr 8213cf24 /data/data/com.appc.test/lib/libkroll-v8.so\r\n11-05 16:50:45.968: I/DEBUG(9126): code around pc:\r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cf70 e12fff33 e3a00000 e8bd8070 e59f3070 \r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cf80 e7943003 e5d33000 e3530000 1affffec \r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cf90 e5963000 e3130001 03a00001 08bd8070 \r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cfa0 e2032003 e3520001 13a00000 18bd8070 \r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cfb0 e5133001 e5d30007 e3500084 13a00000 \r\n11-05 16:50:45.968: I/DEBUG(9126): code around lr:\r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cf04 e92d4070 e59f40cc e59f50cc e08f4004 \r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cf14 e7943005 e1a06000 e5930000 eb053954 \r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cf24 e5903000 e3530001 0a000017 e59f30ac \r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cf34 e7943003 e5d33000 e3530000 0a00000d \r\n11-05 16:50:45.968: I/DEBUG(9126): 8213cf44 e7943005 e5930000 eb053949 e59f2090 \r\n11-05 16:50:45.968: I/DEBUG(9126): stack:\r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a18 002fe958 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a1c 00002714 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a20 002cc1c0 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a24 00000001 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a28 00337748 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a2c 002cc168 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a30 405ed840 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a34 aca45399 /system/lib/libdvm.so\r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a38 002fd974 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a3c 00000000 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a40 00000000 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a44 82072cf9 /data/data/com.appc.test/lib/libkroll-v8.so\r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a48 002dc9a0 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a4c 82073cd3 /data/data/com.appc.test/lib/libkroll-v8.so\r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a50 df002777 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a54 e3a070ad \r\n11-05 16:50:45.968: I/DEBUG(9126): #00 44e14a58 8253f1e0 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a5c 002dc9a0 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a60 00000000 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a64 82073671 /data/data/com.appc.test/lib/libkroll-v8.so\r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a68 00337748 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a6c 0000a000 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a70 00337748 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a74 00000000 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a78 002fd964 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a7c afd138af /system/lib/libc.so\r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a80 8253f1e0 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a84 44e14ab0 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a88 000013f8 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a8c 8253f1e0 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a90 44e14ab0 \r\n11-05 16:50:45.968: I/DEBUG(9126): 44e14a94 000013f8 \r\n11-05 16:50:45.976: I/DEBUG(9126): 44e14a98 00000000 \r\n11-05 16:50:45.976: I/DEBUG(9126): 44e14a9c 00337748 \r\n11-05 16:50:47.086: D/dalvikvm(1855): GC_EXPLICIT freed 2K, 51% free 3520K/7175K, external 2357K/2773K, paused 35ms\r\n11-05 16:50:48.398: I/DEBUG(9126): debuggerd committing suicide to free the zombie!\r\n11-05 16:50:48.398: I/BootReceiver(499): Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)\r\n11-05 16:50:48.429: E/InputDispatcher(499): channel '40b8b510 com.appc.test/com.appc.test._1bestpracticesActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x8\r\n11-05 16:50:48.429: E/InputDispatcher(499): channel '40b8b510 com.appc.test/com.appc.test._1bestpracticesActivity (server)' ~ Channel is unrecoverably broken and will be disposed!\r\n11-05 16:50:48.429: D/Zygote(275): Process 8253 terminated by signal (11)\r\n11-05 16:50:48.484: D/dalvikvm(499): GC_FOR_MALLOC freed 931K, 30% free 10108K/14407K, external 8158K/10188K, paused 89ms\r\n11-05 16:50:48.484: I/dalvikvm-heap(499): Grow heap (frag case) to 20.005MB for 87396-byte allocation\r\n11-05 16:50:48.570: D/dalvikvm(499): GC_FOR_MALLOC freed <1K, 30% free 10193K/14535K, external 8158K/10188K, paused 75ms\r\n11-05 16:50:48.570: I/WindowManager(499): WINDOW DIED Window{40b8b510 com.appc.test/com.appc.test._1bestpracticesActivity paused=false}\r\n11-05 16:50:48.570: I/ActivityManager(499): Process com.appc.test (pid 8253) has died.\r\n11-05 16:50:48.578: W/WindowManager(499): Failed looking up window\r\n11-05 16:50:48.578: W/WindowManager(499): java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@40b258a8 does not exist\r\n11-05 16:50:48.578: W/WindowManager(499): \tat com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:8590)\r\n11-05 16:50:48.578: W/WindowManager(499): \tat com.android.server.WindowManagerService.windowForClientLocked(WindowManagerService.java:8581)\r\n11-05 16:50:48.578: W/WindowManager(499): \tat com.android.server.WindowManagerService$WindowState$DeathRecipient.binderDied(WindowManagerService.java:7440)\r\n11-05 16:50:48.578: W/WindowManager(499): \tat android.os.BinderProxy.sendDeathNotice(Binder.java:397)\r\n11-05 16:50:48.578: W/WindowManager(499): \tat dalvik.system.NativeStart.run(Native Method)\r\n11-05 16:50:48.578: I/WindowManager(499): WIN DEATH: null\r\n{code}\r\n\r\nh5.Repro sequence\r\nh6.app.js\r\n{code}\r\nTi.include('suds.js');\r\n\r\nvar webServiceMethod = [\"GetItemsList\", \"GetUOMList\", \"GetItemPriceList\", \"GetBankList\", \"GetBillReferanceList\", \"GetCategoryList\", \"GetPayTermsList\", \"GetPayModeList\", \"GetReasonList\", \"GetPriceGroupList\", \"GetCustomerAgentList\", \"GetServiceMasterList\", \"GetCurrencyUnitList\", \"GetCustomerProductList\", \"GetVanInventoryNew\", \"GetAgentListNew\", \"GetCreditNoteList\", \"GetCreditNoteItemsList\", \"GetInvoicesList\", \"GetInvoiceItemsList\", \"GetRouteMasterList\", \"GetRouteDetailsList\", \"GetSystemTable\", \"GetLocationList\", \"GetOrderHeaderList\", \"GetOrderItemsList\", \"GetCustomersList\"];\r\nvar APIStatus = [];\r\n\r\nvar win = Titanium.UI.createWindow({ \r\n title:'Sample Web Service Call',\r\n backgroundColor:'#000'\r\n});\r\n\r\nvar label = Titanium.UI.createLabel({\r\n\tcolor:'#fff',\r\n\ttext:'Titanium HTTPClient Heap Memory Deallocation Issue Example',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\twidth:'auto',\r\n\ttop:'5%'\r\n});\r\n\r\nlabel.addEventListener('click',function(){\r\n\tWebserviceStart()\r\n});\r\n\r\nvar button = Titanium.UI.createButton({\r\n\ttitle : \"Start WebService Call\",\r\n\twidth : '50%',\r\n\theight : 60,\r\n\tborderRadius : 6,\r\n\ttop:'10%'\r\n});\r\n\r\nbutton.addEventListener('click',function(){\r\n\tWebserviceStart()\r\n});\r\n\r\nvar actInd = Titanium.UI.createActivityIndicator({\r\n\tfont : {\r\n\t\tfontFamily : 'Helvetica Neue',\r\n\t\tfontSize : 30,\r\n\t\tfontWeight : 'bold'\r\n\t},\r\n\tcolor : 'white',\r\n\tmessage : 'Loading...',\r\n\theight : win.height,\r\n\twidth : win.width,\r\n\tzIndex : 50\r\n});\r\n\r\nvar suds = new SudsClient({\r\n\tendpoint : \"http://meijiservice.cloudapp.net/Service.asmx\",\r\n\ttargetNamespace : \"http://tempuri.org\"\r\n});\r\n\r\nwin.add(label);\r\nwin.add(button);\r\nwin.add(actInd);\r\nwin.open();\r\n\r\n\r\nfunction WebserviceStart(){\t\r\n\tvar date = new Date();\r\n\tTi.API.info(\"START TIME: \" + date);\r\n\tvar obj = {};\r\n\tAPIStatus = [];\r\n\tobj.start = 0;\r\n\tobj.end = 2000;\r\n\tobj.action = webServiceMethod[0];\r\n\tactInd.show();\r\n\twebServiceCall(obj);\r\n}\r\n\r\nfunction webServiceCall(obj){\t\r\n\tobj.callparams = {\r\n\t\toffset: obj.start,\r\n\t length: obj.end,\r\n\t mdtNo: \"TAB015\"\r\n\t};\r\n\tsuds.invoke(obj.action, obj.callparams, function(xmlDoc, httpStatus) {\r\n\t\tvar results = xmlDoc.documentElement.getElementsByTagName(obj.action+'Response');\r\n\t\tvar result = results.item(0).text;\r\n\t\tvar data = JSON.parse(\"[\"+result+\"]\");\r\n\t\tvar totalLength = data[0].TotalLength[0].TotalLength;\r\n\t\tvar totalAddedRecord = (parseInt(data[0].TotalLength[0].Length)+parseInt(data[0].TotalLength[0].Offset));\r\n\t\tTi.API.info(\"Action:\"+ obj.action +\" TotalLength:\"+totalLength+\" Start:\"+ (totalAddedRecord-2000) + \"End:\"+totalAddedRecord);\r\n\t\tif(totalLength==0 || totalLength';\r\n } else {\r\n xml += '<'+key+'>';\r\n }\r\n if (isArray(_obj[key]) || (typeof _obj[key] == 'object' && _obj[key] != null)) {\r\n xml += convertToXml(_obj[key]);\r\n }\r\n else {\r\n xml += _obj[key];\r\n }\r\n if (namespacePrefix && namespacePrefix.length) {\r\n xml += '';\r\n } else {\r\n xml += '';\r\n }\r\n }\r\n }\r\n return xml;\r\n }\r\n \r\n // Client Configuration\r\n var config = extend({\r\n endpoint:'http://localhost',\r\n targetNamespace: 'http://localhost',\r\n //envelopeBegin: '',\r\n\tenvelopeBegin: '',\r\n envelopeEnd: ''\r\n },_options);\r\n \r\n // Invoke a web service\r\n this.invoke = function(_soapAction,_body,_callback) { \r\n //Build request body \r\n var body = _body;\r\n \r\n //Allow straight string input for XML body - if not, build from object\r\n if (typeof body !== 'string') {\r\n /*body = '';\r\n body += convertToXml(_body, 'ns0');\r\n body += '';*/\r\n body = '<'+_soapAction+' xmlns=\"http://tempuri.org/\">';\r\n body += convertToXml(_body, '');\r\n body += '';\r\n }\r\n\r\n var ebegin = config.envelopeBegin;\r\n config.envelopeBegin = ebegin.replace('PLACEHOLDER', config.targetNamespace);\r\n \r\n //Build Soapaction header - if no trailing slash in namespace, need to splice one in for soap action\r\n var soapAction = '';\r\n if (config.targetNamespace.lastIndexOf('/') != config.targetNamespace.length - 1) {\r\n soapAction = config.targetNamespace+'/'+_soapAction;\r\n }\r\n else {\r\n soapAction = config.targetNamespace+_soapAction;\r\n }\r\n \r\n //POST XML document to service endpoint\r\n var xhr = getXHR();\r\n xhr.onload = function() {\r\n //Ti.API.info('Response Text ---->'+this.responseText);\r\n _callback.call(this, xmlDomFromString(this.responseText),xhr.status);\r\n \r\n };\r\n xhr.onerror = function() {\r\n \t//Ti.API.info('Error Response Text ---->'+this.responseText);\r\n _callback.call(this, '',xhr.status);\r\n };\r\n xhr.open('POST',config.endpoint);\r\n\t\txhr.setRequestHeader('Content-Type', 'text/xml');\r\n\t\t//Ti.API.info('soapActio---->'+soapAction);\r\n\t\txhr.setRequestHeader('SOAPAction', soapAction);\r\n\t\t//Ti.API.info('ReQ---->'+config.envelopeBegin+body+config.envelopeEnd);\r\n\t\txhr.send(config.envelopeBegin+body+config.envelopeEnd);\r\n };\r\n}\r\n{code}\r\n\r\nh6.Customer remarks\r\nTo observe Heap Memory, use Deprecated LogCat from DDMS and filter with the key word \"Heap\". I have attached screen shot and .apk as well.\r\n\r\nPlease help us to resolve it soon, as our project is in really critical phase and getting delayed because of \"Out Of Memory Exception\".\r\n\r\nHow ever same code works awesome on IOS but this critical issue is only with Android.\r\n\r\nh6.Associated thread Community\r\nhttp://developer.appcelerator.com/question/144219/http-client-sudsjs-fails-to-deallocate-heap-memory", "attachment": [ { "id": "32677", "filename": "app.apk", "author": { "name": "mutturajb@gmail.com", "key": "mutturajb@gmail.com", "displayName": "mutturaj", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-16T07:01:37.000+0000", "size": 8345579, "mimeType": "application/octet-stream" }, { "id": "32678", "filename": "HTTPClient_OutOfMemory_ISSUE-tiff.jpg", "author": { "name": "mutturajb@gmail.com", "key": "mutturajb@gmail.com", "displayName": "mutturaj", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-16T07:01:37.000+0000", "size": 311852, "mimeType": "image/jpeg" }, { "id": "32676", "filename": "webserviceCall copy.zip", "author": { "name": "mutturajb@gmail.com", "key": "mutturajb@gmail.com", "displayName": "mutturaj", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-16T07:01:37.000+0000", "size": 68262, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: HTTPClient fails to deallocate Heap Memory", "creator": { "name": "mutturajb@gmail.com", "key": "mutturajb@gmail.com", "displayName": "mutturaj", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "mutturajb@gmail.com", "key": "mutturajb@gmail.com", "displayName": "mutturaj", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "MAC OS 10.7.5\r\nTitanium SDK: 2.1.3.GA & 3.0 CI Build\r\nAndroid OS: 2.3.5 & 4.0.4\r\nAndroid Runtime: V8", "closedSprints": [ { "id": 50, "state": "closed", "name": "2014 Sprint 09 Tooling", "startDate": "2014-04-28T15:43:24.381Z", "endDate": "2014-05-10T03:44:00.000Z", "completeDate": "2014-05-12T13:36:16.254Z", "originBoardId": 113 } ], "comment": { "comments": [ { "id": "226228", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Updated Test Case, reproduction steps and labels. It should be moved to main project to dig into it. ", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-11-05T23:10:11.000+0000", "updated": "2012-11-05T23:10:11.000+0000" }, { "id": "276932", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "\r\nChange the inner classes to static classes so that parent is garbage collected even though inner class instance is referenced (in this case, the ClientRunnable and the thread)\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4862", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-10-27T17:41:53.000+0000", "updated": "2013-10-27T17:41:53.000+0000" }, { "id": "291134", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Looks like the server mentioned in the test case is down.", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-02-04T17:03:41.000+0000", "updated": "2014-02-04T17:03:41.000+0000" }, { "id": "291312", "author": { "name": "mutturajb@gmail.com", "key": "mutturajb@gmail.com", "displayName": "mutturaj", "active": true, "timeZone": "America/Los_Angeles" }, "body": "\r\nHi Sunila,\r\n\r\nI have uploaded new installer apk and source code in below links.\r\n\r\nSource Code : \r\nhttps://dl.dropboxusercontent.com/u/65664379/AppceleratorMemoryIssueExample/source/webserviceCall%20copy%202.zip\r\n\r\napk:\r\nhttps://dl.dropboxusercontent.com/u/65664379/AppceleratorMemoryIssueExample/installer/app.apk\r\n\r\nSorry for the inconvenience.\r\n\r\nRegards,\r\nMutturaj\r\n", "updateAuthor": { "name": "mutturajb@gmail.com", "key": "mutturajb@gmail.com", "displayName": "mutturaj", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T05:15:34.000+0000", "updated": "2014-02-05T05:15:34.000+0000" }, { "id": "304455", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/5670", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-12T21:06:06.000+0000", "updated": "2014-05-12T21:06:06.000+0000" }, { "id": "304549", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Testde using the app mentioned by mutturaj.\r\nHttpClient successfully deallocate heap memory and app does not crash after reaching certain amount of memory ,also no memory exceptions are generated. \r\n\r\nVerified the fix on:\r\nDevice : Google Nexus 5, Android Version: 4.4.2\r\nSDK: 3.3.0.v20140512162513\r\nCLI version : 3.3.0-dev\r\nOS : MAC OSX 10.9.2\r\nAlloy: 1.4.0-dev\r\nACS: 1.0.14\r\nnpm:1.3.2\r\nLiveView: 1.0.4\r\nAppcelerator Studio, build: 3.3.0.201405121247\r\ntitanium-code-processor: 1.1.1\r\nXCode : 5.1.1", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-05-13T09:46:32.000+0000", "updated": "2014-05-13T09:46:32.000+0000" }, { "id": "308576", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The PR that fixed this has a bug, reopening this ticket to fix that bug.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-12T00:30:08.000+0000", "updated": "2014-06-12T00:30:08.000+0000" }, { "id": "308692", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR https://github.com/appcelerator/titanium_mobile/pull/5794\r\n3.3.X PR https://github.com/appcelerator/titanium_mobile/pull/5795", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-12T16:57:59.000+0000", "updated": "2014-06-12T17:15:39.000+0000" }, { "id": "309402", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix. Used the app source code attached by [~mutturajb@gmail.com].\r\nWe do not see \"Out Of Memory Exceptions\" & the app does not crash.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 3.3.0.201406111952\r\nTi SDK : 3.3.0.v20140616174113\r\nMac OSX : 10.8.5\r\nAlloy : 1.4.0-rc\r\nCLI - 3.3.0-rc\r\nCode Processor: 1.1.1\r\nsony xperia: 2.3.7\r\nandroid emulator: 4.0.3", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-17T20:55:18.000+0000", "updated": "2014-06-17T20:55:18.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }