如何处理与AsyncTask一起使用的OutOfMemoryError [内存耗尽]?

时间:2013-02-01 08:08:37

标签: android android-asynctask android-ksoap2

我已经制作了一个应用程序,其中我使用soap从Magento框架获取产品列表,Magento中有10000个产品,这是网络任务,所以我实现了soap调用并解析了AsyncTask的doInBackground方法中的响应,

但问题在于它给了我

Caused by: java.lang.OutOfMemoryError: [memory exhausted] 

有任何帮助??


我只是将用于存储产品信息的代码删除到DTO的ArrayList中,但它仍然给出了相同的错误,我只是调试应用程序,它在调用soap之后不执行

  

“androidHttpTransport.call(”“,envelope);”,

并从此行重新分配内存需要,它给出了OutOfMemoryError

请参阅下面的日志...

02-01 14:48:39.176: W/KeyCharacterMap(526): No keyboard for id 0
02-01 14:48:39.176: W/KeyCharacterMap(526): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
02-01 14:48:39.253: V/TabGroup2Activity(526): finish from child , mIdList size = 2
02-01 14:48:39.253: V/TabGroup2Activity(526): Last id = OptionsActivity2
02-01 14:48:39.313: V/ProductOptionActivity(526): in on resume
02-01 14:48:45.323: D/dalvikvm(526): GC_EXPLICIT freed 281K, 59% free 2820K/6727K, external 7035K/8182K, paused 102ms
02-01 14:50:15.393: V/Info before check(563): nullnullnull
02-01 14:50:15.403: V/Hello(563): Hello
02-01 14:50:15.403: V/Hello(563): test...http://magento.cybercom.in/mobile/magentoadminadmin123
02-01 14:50:15.553: D/dalvikvm(563): GC_EXTERNAL_ALLOC freed 81K, 51% free 2663K/5379K, external 1819K/2137K, paused 53ms
02-01 14:50:15.844: D/dalvikvm(563): GC_EXTERNAL_ALLOC freed 19K, 51% free 2687K/5379K, external 2348K/2704K, paused 91ms
02-01 14:50:16.033: V/TabGroup1Activity(563): id = OptionsActivity
02-01 14:50:16.033: V/TabGroup1Activity(563): start child , mIdList size = 1
02-01 14:50:35.883: D/dalvikvm(563): GC_CONCURRENT freed 892K, 53% free 3165K/6727K, external 3600K/4216K, paused 5ms+3ms
02-01 14:50:36.773: I/dalvikvm(563): Jit: resizing JitTable from 512 to 1024
02-01 14:50:37.543: D/dalvikvm(563): GC_CONCURRENT freed 931K, 50% free 3594K/7175K, external 3600K/4216K, paused 4ms+4ms
02-01 14:50:39.123: D/dalvikvm(563): GC_CONCURRENT freed 1029K, 48% free 4067K/7751K, external 3600K/4216K, paused 9ms+4ms
02-01 14:50:40.423: D/dalvikvm(563): GC_CONCURRENT freed 1111K, 46% free 4571K/8391K, external 3600K/4216K, paused 4ms+3ms
02-01 14:50:41.823: D/dalvikvm(563): GC_CONCURRENT freed 1250K, 44% free 5138K/9095K, external 3600K/4216K, paused 4ms+5ms
02-01 14:50:43.293: D/dalvikvm(563): GC_CONCURRENT freed 1338K, 42% free 5746K/9799K, external 3600K/4216K, paused 7ms+4ms
02-01 14:50:44.633: D/dalvikvm(563): GC_FOR_MALLOC freed 1342K, 40% free 6358K/10439K, external 3600K/4216K, paused 129ms
02-01 14:50:45.884: D/dalvikvm(563): GC_FOR_MALLOC freed 1302K, 37% free 6952K/11015K, external 3600K/4216K, paused 139ms
02-01 14:50:47.204: D/dalvikvm(563): GC_FOR_MALLOC freed 1319K, 36% free 7555K/11655K, external 3600K/4216K, paused 146ms
02-01 14:50:48.364: D/dalvikvm(563): GC_FOR_MALLOC freed 1287K, 34% free 8143K/12231K, external 3600K/4216K, paused 157ms
02-01 14:50:49.664: D/dalvikvm(563): GC_FOR_MALLOC freed 1265K, 32% free 8721K/12807K, external 3600K/4216K, paused 177ms
02-01 14:50:50.794: D/dalvikvm(563): GC_FOR_MALLOC freed 1251K, 31% free 9292K/13383K, external 3600K/4216K, paused 180ms
02-01 14:50:51.944: D/dalvikvm(563): GC_FOR_MALLOC freed 1241K, 30% free 9858K/13959K, external 3600K/4216K, paused 193ms
02-01 14:50:53.124: D/dalvikvm(563): GC_FOR_MALLOC freed 1234K, 29% free 10422K/14535K, external 3600K/4216K, paused 204ms
02-01 14:50:54.285: D/dalvikvm(563): GC_FOR_MALLOC freed 1229K, 28% free 10982K/15111K, external 3600K/4216K, paused 207ms
02-01 14:50:55.455: D/dalvikvm(563): GC_FOR_MALLOC freed 1226K, 27% free 11543K/15687K, external 3600K/4216K, paused 251ms
02-01 14:50:56.655: D/dalvikvm(563): GC_FOR_MALLOC freed 1180K, 26% free 12081K/16199K, external 3600K/4216K, paused 231ms
02-01 14:50:57.803: D/dalvikvm(563): GC_FOR_MALLOC freed 1193K, 25% free 12626K/16775K, external 3600K/4216K, paused 240ms
02-01 14:50:58.943: D/dalvikvm(563): GC_FOR_MALLOC freed 1157K, 24% free 13154K/17287K, external 3600K/4216K, paused 248ms
02-01 14:51:00.123: D/dalvikvm(563): GC_FOR_MALLOC freed 1177K, 24% free 13692K/17863K, external 3600K/4216K, paused 294ms
02-01 14:51:01.253: D/dalvikvm(563): GC_FOR_MALLOC freed 1147K, 23% free 14215K/18375K, external 3600K/4216K, paused 310ms
02-01 14:51:02.393: D/dalvikvm(563): GC_FOR_MALLOC freed 1127K, 23% free 14730K/18887K, external 3600K/4216K, paused 276ms
02-01 14:51:03.544: D/dalvikvm(563): GC_FOR_MALLOC freed 1114K, 22% free 15238K/19399K, external 3600K/4216K, paused 283ms
02-01 14:51:04.734: D/dalvikvm(563): GC_FOR_MALLOC freed 1105K, 21% free 15742K/19911K, external 3600K/4216K, paused 364ms
02-01 14:51:05.995: D/dalvikvm(563): GC_FOR_MALLOC freed 1098K, 21% free 16244K/20423K, external 3600K/4216K, paused 310ms
02-01 14:51:07.083: I/dalvikvm-heap(563): Clamp target GC heap from 24.410MB to 24.000MB
02-01 14:51:07.093: D/dalvikvm(563): GC_FOR_MALLOC freed 1093K, 21% free 16743K/20935K, external 3600K/4216K, paused 308ms
02-01 14:51:08.173: I/dalvikvm-heap(563): Clamp target GC heap from 24.758MB to 24.000MB
02-01 14:51:08.193: D/dalvikvm(563): GC_FOR_MALLOC freed 782K, 19% free 17100K/20999K, external 3600K/4216K, paused 330ms
02-01 14:51:08.953: I/dalvikvm-heap(563): Clamp target GC heap from 24.996MB to 24.000MB
02-01 14:51:08.998: D/dalvikvm(563): GC_FOR_MALLOC freed 531K, 18% free 17343K/20999K, external 3600K/4216K, paused 310ms
02-01 14:51:09.593: I/dalvikvm-heap(563): Clamp target GC heap from 25.158MB to 24.000MB
02-01 14:51:09.603: D/dalvikvm(563): GC_FOR_MALLOC freed 362K, 17% free 17508K/20999K, external 3600K/4216K, paused 311ms
02-01 14:51:10.163: I/dalvikvm-heap(563): Clamp target GC heap from 25.267MB to 24.000MB
02-01 14:51:10.183: D/dalvikvm(563): GC_FOR_MALLOC freed 247K, 17% free 17621K/20999K, external 3600K/4216K, paused 310ms
02-01 14:51:10.693: I/dalvikvm-heap(563): Clamp target GC heap from 25.342MB to 24.000MB
02-01 14:51:10.705: D/dalvikvm(563): GC_FOR_MALLOC freed 168K, 16% free 17698K/20999K, external 3600K/4216K, paused 319ms
02-01 14:51:11.143: I/dalvikvm-heap(563): Clamp target GC heap from 25.394MB to 24.000MB
02-01 14:51:11.163: D/dalvikvm(563): GC_FOR_MALLOC freed 115K, 16% free 17751K/20999K, external 3600K/4216K, paused 305ms
02-01 14:51:11.623: I/dalvikvm-heap(563): Clamp target GC heap from 25.429MB to 24.000MB
02-01 14:51:11.677: D/dalvikvm(563): GC_FOR_MALLOC freed 78K, 16% free 17787K/20999K, external 3600K/4216K, paused 385ms
02-01 14:51:12.134: I/dalvikvm-heap(563): Clamp target GC heap from 25.453MB to 24.000MB
02-01 14:51:12.153: D/dalvikvm(563): GC_FOR_MALLOC freed 53K, 16% free 17811K/20999K, external 3600K/4216K, paused 408ms
02-01 14:51:12.613: I/dalvikvm-heap(563): Clamp target GC heap from 25.469MB to 24.000MB
02-01 14:51:12.623: D/dalvikvm(563): GC_FOR_MALLOC freed 36K, 16% free 17828K/20999K, external 3600K/4216K, paused 373ms
02-01 14:51:13.043: I/dalvikvm-heap(563): Clamp target GC heap from 25.480MB to 24.000MB
02-01 14:51:13.063: D/dalvikvm(563): GC_FOR_MALLOC freed 24K, 16% free 17839K/20999K, external 3600K/4216K, paused 404ms
02-01 14:51:13.453: I/dalvikvm-heap(563): Clamp target GC heap from 25.487MB to 24.000MB
02-01 14:51:13.463: D/dalvikvm(563): GC_FOR_MALLOC freed 15K, 16% free 17846K/20999K, external 3600K/4216K, paused 381ms
02-01 14:51:13.854: I/dalvikvm-heap(563): Clamp target GC heap from 25.492MB to 24.000MB
02-01 14:51:13.863: D/dalvikvm(563): GC_FOR_MALLOC freed 9K, 15% free 17850K/20999K, external 3600K/4216K, paused 357ms
02-01 14:51:14.203: I/dalvikvm-heap(563): Clamp target GC heap from 25.494MB to 24.000MB
02-01 14:51:14.213: D/dalvikvm(563): GC_FOR_MALLOC freed 5K, 15% free 17853K/20999K, external 3600K/4216K, paused 337ms
02-01 14:51:14.613: I/dalvikvm-heap(563): Clamp target GC heap from 25.496MB to 24.000MB
02-01 14:51:14.643: D/dalvikvm(563): GC_FOR_MALLOC freed 3K, 15% free 17855K/20999K, external 3600K/4216K, paused 407ms
02-01 14:51:14.983: I/dalvikvm-heap(563): Clamp target GC heap from 25.497MB to 24.000MB
02-01 14:51:14.993: D/dalvikvm(563): GC_FOR_MALLOC freed 2K, 15% free 17855K/20999K, external 3600K/4216K, paused 343ms
02-01 14:51:15.323: I/dalvikvm-heap(563): Clamp target GC heap from 25.497MB to 24.000MB
02-01 14:51:15.333: D/dalvikvm(563): GC_FOR_MALLOC freed 1K, 15% free 17856K/20999K, external 3600K/4216K, paused 330ms
02-01 14:51:15.703: I/dalvikvm-heap(563): Clamp target GC heap from 25.498MB to 24.000MB
02-01 14:51:15.713: D/dalvikvm(563): GC_FOR_MALLOC freed <1K, 15% free 17857K/20999K, external 3600K/4216K, paused 359ms
02-01 14:51:16.233: I/dalvikvm-heap(563): Clamp target GC heap from 25.498MB to 24.000MB
02-01 14:51:16.269: D/dalvikvm(563): GC_FOR_MALLOC freed <1K, 15% free 17857K/20999K, external 3600K/4216K, paused 518ms
02-01 14:51:16.753: I/dalvikvm-heap(563): Clamp target GC heap from 25.498MB to 24.000MB
02-01 14:51:16.773: D/dalvikvm(563): GC_FOR_MALLOC freed 0K, 15% free 17857K/20999K, external 3600K/4216K, paused 419ms
02-01 14:51:16.773: I/dalvikvm-heap(563): Forcing collection of SoftReferences for 32-byte allocation
02-01 14:51:17.233: I/dalvikvm-heap(563): Clamp target GC heap from 25.496MB to 24.000MB
02-01 14:51:17.253: D/dalvikvm(563): GC_FOR_MALLOC freed 1K, 15% free 17855K/20999K, external 3600K/4216K, paused 465ms
02-01 14:51:17.613: I/dalvikvm-heap(563): Clamp target GC heap from 25.498MB to 24.000MB
02-01 14:51:17.623: D/dalvikvm(563): GC_FOR_MALLOC freed 2K, 15% free 17857K/20999K, external 3600K/4216K, paused 365ms
02-01 14:51:18.045: I/dalvikvm-heap(563): Clamp target GC heap from 25.499MB to 24.000MB
02-01 14:51:18.066: D/dalvikvm(563): GC_FOR_MALLOC freed 1K, 15% free 17857K/20999K, external 3600K/4216K, paused 416ms
02-01 14:51:18.463: I/dalvikvm-heap(563): Clamp target GC heap from 25.499MB to 24.000MB
02-01 14:51:18.493: D/dalvikvm(563): GC_FOR_MALLOC freed 1K, 15% free 17858K/20999K, external 3600K/4216K, paused 401ms
02-01 14:51:18.923: I/dalvikvm-heap(563): Clamp target GC heap from 25.500MB to 24.000MB
02-01 14:51:18.943: D/dalvikvm(563): GC_FOR_MALLOC freed <1K, 15% free 17858K/20999K, external 3600K/4216K, paused 438ms
02-01 14:51:19.313: I/dalvikvm-heap(563): Clamp target GC heap from 25.500MB to 24.000MB
02-01 14:51:19.325: D/dalvikvm(563): GC_FOR_MALLOC freed <1K, 15% free 17858K/20999K, external 3600K/4216K, paused 369ms
02-01 14:51:19.683: I/dalvikvm-heap(563): Clamp target GC heap from 25.500MB to 24.000MB
02-01 14:51:19.713: D/dalvikvm(563): GC_FOR_MALLOC freed <1K, 15% free 17858K/20999K, external 3600K/4216K, paused 357ms
02-01 14:51:19.713: I/dalvikvm-heap(563): Forcing collection of SoftReferences for 44-byte allocation
02-01 14:51:20.113: I/dalvikvm-heap(563): Clamp target GC heap from 25.500MB to 24.000MB
02-01 14:51:20.133: D/dalvikvm(563): GC_FOR_MALLOC freed 0K, 15% free 17858K/20999K, external 3600K/4216K, paused 409ms
02-01 14:51:20.133: E/dalvikvm-heap(563): Out of memory on a 44-byte allocation.
02-01 14:51:20.133: I/dalvikvm(563): "AsyncTask #1" prio=5 tid=9 RUNNABLE JIT
02-01 14:51:20.133: I/dalvikvm(563):   | group="main" sCount=0 dsCount=0 obj=0x405339b8 self=0x2b8fa8
02-01 14:51:20.133: I/dalvikvm(563):   | sysTid=572 nice=10 sched=0/0 cgrp=bg_non_interactive handle=2853696
02-01 14:51:20.133: I/dalvikvm(563):   | schedstat=( 39823809736 8700307287 2410 )
02-01 14:51:20.133: I/dalvikvm(563):   at java.lang.String.<init>(String.java:~513)
02-01 14:51:20.133: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.get(KXmlParser.java:610)
02-01 14:51:20.133: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.parseStartTag(KXmlParser.java:719)
02-01 14:51:20.133: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.nextImpl(KXmlParser.java:342)
02-01 14:51:20.133: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.next(KXmlParser.java:1378)
02-01 14:51:20.133: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1408)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:275)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:389)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:273)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:389)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readVector(SoapSerializationEnvelope.java:323)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readInstance(SoapSerializationEnvelope.java:446)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:387)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:273)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:389)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:151)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.transport.Transport.parseResponse(Transport.java:100)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:214)
02-01 14:51:20.133: I/dalvikvm(563):   at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:96)
02-01 14:51:20.133: I/dalvikvm(563):   at com.magentodemo.MainActivity$DownloadWebPageTask.doInBackground(MainActivity.java:475)
02-01 14:51:20.133: I/dalvikvm(563):   at com.magentodemo.MainActivity$DownloadWebPageTask.doInBackground(MainActivity.java:1)
02-01 14:51:20.133: I/dalvikvm(563):   at android.os.AsyncTask$2.call(AsyncTask.java:185)
02-01 14:51:20.133: I/dalvikvm(563):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
02-01 14:51:20.133: I/dalvikvm(563):   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
02-01 14:51:20.153: I/dalvikvm(563):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
02-01 14:51:20.153: I/dalvikvm(563):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
02-01 14:51:20.153: I/dalvikvm(563):   at java.lang.Thread.run(Thread.java:1019)
02-01 14:51:20.523: I/dalvikvm-heap(563): Clamp target GC heap from 25.500MB to 24.000MB
02-01 14:51:20.533: D/dalvikvm(563): GC_FOR_MALLOC freed <1K, 15% free 17858K/20999K, external 3600K/4216K, paused 355ms
02-01 14:51:20.533: I/dalvikvm-heap(563): Forcing collection of SoftReferences for 240-byte allocation
02-01 14:51:20.863: I/dalvikvm-heap(563): Clamp target GC heap from 25.500MB to 24.000MB
02-01 14:51:20.873: D/dalvikvm(563): GC_FOR_MALLOC freed 0K, 15% free 17858K/20999K, external 3600K/4216K, paused 330ms
02-01 14:51:20.873: E/dalvikvm-heap(563): Out of memory on a 240-byte allocation.
02-01 14:51:20.873: I/dalvikvm(563): "AsyncTask #1" prio=5 tid=9 RUNNABLE
02-01 14:51:20.873: I/dalvikvm(563):   | group="main" sCount=0 dsCount=0 obj=0x405339b8 self=0x2b8fa8
02-01 14:51:20.873: I/dalvikvm(563):   | sysTid=572 nice=10 sched=0/0 cgrp=bg_non_interactive handle=2853696
02-01 14:51:20.873: I/dalvikvm(563):   | schedstat=( 40517822073 8767874467 2431 )
02-01 14:51:20.873: I/dalvikvm(563):   at java.lang.Throwable.nativeFillInStackTrace(Native Method)
02-01 14:51:20.873: I/dalvikvm(563):   at java.lang.Throwable.fillInStackTrace(Throwable.java:135)
02-01 14:51:20.873: I/dalvikvm(563):   at java.lang.Throwable.<init>(Throwable.java:74)
02-01 14:51:20.873: I/dalvikvm(563):   at java.lang.Error.<init>(Error.java:38)
02-01 14:51:20.873: I/dalvikvm(563):   at java.lang.VirtualMachineError.<init>(VirtualMachineError.java:36)
02-01 14:51:20.873: I/dalvikvm(563):   at java.lang.OutOfMemoryError.<init>(OutOfMemoryError.java:34)
02-01 14:51:20.873: I/dalvikvm(563):   at java.lang.String.<init>(String.java:-1)
02-01 14:51:20.873: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.get(KXmlParser.java:610)
02-01 14:51:20.873: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.parseStartTag(KXmlParser.java:719)
02-01 14:51:20.873: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.nextImpl(KXmlParser.java:342)
02-01 14:51:20.873: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.next(KXmlParser.java:1378)
02-01 14:51:20.873: I/dalvikvm(563):   at org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1408)
02-01 14:51:20.873: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:275)
02-01 14:51:20.873: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:389)
02-01 14:51:20.873: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:273)
02-01 14:51:20.873: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:389)
02-01 14:51:20.873: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readVector(SoapSerializationEnvelope.java:323)
02-01 14:51:20.873: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readInstance(SoapSerializationEnvelope.java:446)
02-01 14:51:20.873: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:387)
02-01 14:51:20.873: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:273)
02-01 14:51:20.873: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:389)
02-01 14:51:20.883: I/dalvikvm(563):   at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:151)
02-01 14:51:20.883: I/dalvikvm(563):   at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140)
02-01 14:51:20.883: I/dalvikvm(563):   at org.ksoap2.transport.Transport.parseResponse(Transport.java:100)
02-01 14:51:20.883: I/dalvikvm(563):   at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:214)
02-01 14:51:20.883: I/dalvikvm(563):   at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:96)
02-01 14:51:20.883: I/dalvikvm(563):   at com.magentodemo.MainActivity$DownloadWebPageTask.doInBackground(MainActivity.java:475)
02-01 14:51:20.883: I/dalvikvm(563):   at com.magentodemo.MainActivity$DownloadWebPageTask.doInBackground(MainActivity.java:1)
02-01 14:51:20.883: I/dalvikvm(563):   at android.os.AsyncTask$2.call(AsyncTask.java:185)
02-01 14:51:20.883: I/dalvikvm(563):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
02-01 14:51:20.883: I/dalvikvm(563):   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
02-01 14:51:20.883: I/dalvikvm(563):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
02-01 14:51:20.883: I/dalvikvm(563):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
02-01 14:51:20.883: I/dalvikvm(563):   at java.lang.Thread.run(Thread.java:1019)
02-01 14:51:20.883: W/dalvikvm(563): Exception thrown (Ljava/lang/OutOfMemoryError;) while throwing internal exception (Ljava/lang/OutOfMemoryError;)
02-01 14:51:21.343: D/dalvikvm(563): GC_FOR_MALLOC freed 15123K, 87% free 2735K/20999K, external 3600K/4216K, paused 456ms
02-01 14:51:21.343: W/dalvikvm(563): threadid=9: thread exiting with uncaught exception (group=0x40015560)
02-01 14:51:21.353: E/AndroidRuntime(563): FATAL EXCEPTION: AsyncTask #1
02-01 14:51:21.353: E/AndroidRuntime(563): java.lang.RuntimeException: An error occured while executing doInBackground()
02-01 14:51:21.353: E/AndroidRuntime(563):  at android.os.AsyncTask$3.done(AsyncTask.java:200)
02-01 14:51:21.353: E/AndroidRuntime(563):  at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
02-01 14:51:21.353: E/AndroidRuntime(563):  at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
02-01 14:51:21.353: E/AndroidRuntime(563):  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
02-01 14:51:21.353: E/AndroidRuntime(563):  at java.util.concurrent.FutureTask.run(FutureTask.java:138)
02-01 14:51:21.353: E/AndroidRuntime(563):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
02-01 14:51:21.353: E/AndroidRuntime(563):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
02-01 14:51:21.353: E/AndroidRuntime(563):  at java.lang.Thread.run(Thread.java:1019)
02-01 14:51:21.353: E/AndroidRuntime(563): Caused by: java.lang.OutOfMemoryError: [memory exhausted]
02-01 14:51:21.353: E/AndroidRuntime(563):  at dalvik.system.NativeStart.main(Native Method)
02-01 14:51:22.605: E/WindowManager(563): Activity com.magentodemo.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4053cbc8 that was originally added here
02-01 14:51:22.605: E/WindowManager(563): android.view.WindowLeaked: Activity com.magentodemo.MainActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@4053cbc8 that was originally added here
02-01 14:51:22.605: E/WindowManager(563):   at android.view.ViewRoot.<init>(ViewRoot.java:258)
02-01 14:51:22.605: E/WindowManager(563):   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
02-01 14:51:22.605: E/WindowManager(563):   at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
02-01 14:51:22.605: E/WindowManager(563):   at android.view.Window$LocalWindowManager.addView(Window.java:424)
02-01 14:51:22.605: E/WindowManager(563):   at android.app.Dialog.show(Dialog.java:241)
02-01 14:51:22.605: E/WindowManager(563):   at android.app.ProgressDialog.show(ProgressDialog.java:107)
02-01 14:51:22.605: E/WindowManager(563):   at android.app.ProgressDialog.show(ProgressDialog.java:90)
02-01 14:51:22.605: E/WindowManager(563):   at com.magentodemo.MainActivity$DownloadWebPageTask.onPreExecute(MainActivity.java:279)
02-01 14:51:22.605: E/WindowManager(563):   at android.os.AsyncTask.execute(AsyncTask.java:391)
02-01 14:51:22.605: E/WindowManager(563):   at com.magentodemo.MainActivity.onCreate(MainActivity.java:83)
02-01 14:51:22.605: E/WindowManager(563):   at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-01 14:51:22.605: E/WindowManager(563):   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
02-01 14:51:22.605: E/WindowManager(563):   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-01 14:51:22.605: E/WindowManager(563):   at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-01 14:51:22.605: E/WindowManager(563):   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-01 14:51:22.605: E/WindowManager(563):   at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 14:51:22.605: E/WindowManager(563):   at android.os.Looper.loop(Looper.java:123)
02-01 14:51:22.605: E/WindowManager(563):   at android.app.ActivityThread.main(ActivityThread.java:3683)
02-01 14:51:22.605: E/WindowManager(563):   at java.lang.reflect.Method.invokeNative(Native Method)
02-01 14:51:22.605: E/WindowManager(563):   at java.lang.reflect.Method.invoke(Method.java:507)
02-01 14:51:22.605: E/WindowManager(563):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-01 14:51:22.605: E/WindowManager(563):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-01 14:51:22.605: E/WindowManager(563):   at dalvik.system.NativeStart.main(Native Method)
02-01 14:51:27.403: D/dalvikvm(563): GC_EXPLICIT freed 69K, 87% free 2746K/20999K, external 3600K/4216K, paused 45ms

1 个答案:

答案 0 :(得分:0)

在阵列列表中存储数据仅取决于设备VM的可用内存。

如果您的VM可用内存为1 MB, 你可以存储一个byte [1024 * 1024]或Object [256 * 1024]。

的数组

所以可能是因为在ArrayList中存储数据。似乎仍然将数据保存在由设备VM分配的应用程序内存中。

我建议您尝试获取响应,解析并直接将其存储在数据库中,而不使用任何临时数组来将数据保存在应用程序内存中。