我在google上搜索了很多,并找到了一个解决方案。我也尝试过这个解决方案,但我仍然遇到了同样的错误。如果有人能解决这个问题,请帮助我。我在网络服务电话中遇到了以下错误。
'Caused by: java.lang.OutOfMemoryError
at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:94)
at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:124)
at java.lang.StringBuilder.append(StringBuilder.java:271)
at org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1345)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:390)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:310)
at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:269)
at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:431)
at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:301)
at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:431)
at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:147)
at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140)
at org.ksoap2.transport.Transport.parseResponse(Transport.java:129)
at com.example.helper.HttpTransportSE.parseResponse(HttpTransportSE.java:338)
at com.example.helper.HttpTransportSE.call(HttpTransportSE.java:311)
at com.example.helper.HttpTransportSE.call(HttpTransportSE.java:125)
at com.example.helper.HttpTransportSE.call(HttpTransportSE.java:120)
at com.example.helper.HelperFunctions.getAccountList(HelperFunctions.java:293)
at com.example.profiler.SyncData$GetProfiler.doInBackground(SyncData.java:269)
at com.example.profiler.SyncData$GetProfiler.doInBackground(SyncData.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 3 more
java.lang.OutOfMemoryError
at java.lang.AbstractStringBuilder.enlargeBuffer(AbstractStringBuilder.java:94)
at java.lang.AbstractStringBuilder.append0(AbstractStringBuilder.java:124)
at java.lang.StringBuilder.append(StringBuilder.java:271)
at org.kxml2.io.KXmlParser.readValue(KXmlParser.java:1345)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:390)
at org.kxml2.io.KXmlParser.next(KXmlParser.java:310)
at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:269)
at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:431)
at org.ksoap2.serialization.SoapSerializationEnvelope.readUnknown(SoapSerializationEnvelope.java:301)
at org.ksoap2.serialization.SoapSerializationEnvelope.read(SoapSerializationEnvelope.java:431)
at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:147)
at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:140)
at org.ksoap2.transport.Transport.parseResponse(Transport.java:129)
at com.example.helper.HttpTransportSE.parseResponse(HttpTransportSE.java:338)
at com.example.helper.HttpTransportSE.call(HttpTransportSE.java:311)
at com.example.helper.HttpTransportSE.call(HttpTransportSE.java:125)
at com.example.helper.HttpTransportSE.call(HttpTransportSE.java:120)
at com.example.helper.HelperFunctions.getAccountList(HelperFunctions.java:293)
at com.example.profiler.SyncData$GetProfiler.doInBackground(SyncData.java:269)
at com.example.profiler.SyncData$GetProfiler.doInBackground(SyncData.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:288)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)'
答案 0 :(得分:0)
您是否在活动中使用了“位图”?或者在活动中加载了很多数据?
你可以在适当的时候使用Bitmap.recycle();
和System.gc();
。
希望有所帮助:)。