fastjson在Android客户端使用时OOM了

吕悦 发布于 2013/08/16 09:24
阅读 1K+
收藏 0

最近客户端使用FastJson 时,内存溢出了,掉用的时候就放了一个ArrayList进去:

08-15 18:26:46.995: I/dalvikvm(684): "AsyncTask #2" prio=5 tid=28 RUNNABLE
08-15 18:26:46.995: I/dalvikvm(684):   | group="main" sCount=0 dsCount=0 obj=0x420c3cd8 self=0x5136a238
08-15 18:26:46.995: I/dalvikvm(684):   | sysTid=844 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1362538032
08-15 18:26:46.995: I/dalvikvm(684):   | schedstat=( 2505319559 2027234770 5362 ) utm=200 stm=50 core=0
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.SerializeWriter.expandCapacity(SerializeWriter.java:~203)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.SerializeWriter.writeByteArray(SerializeWriter.java:414)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.ByteArraySerializer.write(ByteArraySerializer.java:41)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.ObjectFieldSerializer.writeProperty(ObjectFieldSerializer.java:111)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:180)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.ObjectFieldSerializer.writeProperty(ObjectFieldSerializer.java:111)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:180)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.ObjectFieldSerializer.writeProperty(ObjectFieldSerializer.java:111)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:180)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.ListSerializer.write(ListSerializer.java:126)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:330)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.JSON.toJSONString(JSON.java:383)
08-15 18:26:47.000: I/dalvikvm(684):   at com.alibaba.fastjson.JSON.toJSONString(JSON.java:371)
08-15 18:26:47.000: I/dalvikvm(684):   at com.pro.bw.lestore.AppManager.getAppList(AppManager.java:165)
08-15 18:26:47.000: I/dalvikvm(684):   at com.pro.bw.browser.parser.AmsRegistClientParser.parse(AmsRegistClientParser.java:43)
08-15 18:26:47.000: I/dalvikvm(684):   at com.pro.bw.common.async_http.AbstractRequester.doInBackground(AbstractRequester.java:99)
08-15 18:26:47.000: I/dalvikvm(684):   at com.pro.bw.common.async_http.AbstractRequester.doInBackground(AbstractRequester.java:1)
08-15 18:26:47.000: I/dalvikvm(684):   at android.os.AsyncTask$2.call(AsyncTask.java:287)
08-15 18:26:47.000: I/dalvikvm(684):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-15 18:26:47.000: I/dalvikvm(684):   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-15 18:26:47.000: I/dalvikvm(684):   at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
08-15 18:26:47.000: I/dalvikvm(684):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-15 18:26:47.000: I/dalvikvm(684):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-15 18:26:47.000: I/dalvikvm(684):   at java.lang.Thread.run(Thread.java:856)
08-15 18:26:47.000: W/dalvikvm(684): threadid=28: thread exiting with uncaught exception (group=0x40e6d300)
08-15 18:26:47.005: D/lestore(684): GET http://m.idea123.cn/api/welcome.php?&releaseTime=1376040511&
08-15 18:26:47.010: E/AndroidRuntime(684): FATAL EXCEPTION: AsyncTask #2
08-15 18:26:47.010: E/AndroidRuntime(684): java.lang.RuntimeException: An error occured while executing doInBackground()
08-15 18:26:47.010: E/AndroidRuntime(684): 	at android.os.AsyncTask$3.done(AsyncTask.java:299)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at java.util.concurrent.FutureTask.run(FutureTask.java:137)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at java.lang.Thread.run(Thread.java:856)
08-15 18:26:47.010: E/AndroidRuntime(684): Caused by: java.lang.OutOfMemoryError
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.SerializeWriter.expandCapacity(SerializeWriter.java:203)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.SerializeWriter.writeByteArray(SerializeWriter.java:414)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.ByteArraySerializer.write(ByteArraySerializer.java:41)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.ObjectFieldSerializer.writeProperty(ObjectFieldSerializer.java:111)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:180)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.ObjectFieldSerializer.writeProperty(ObjectFieldSerializer.java:111)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:180)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.ObjectFieldSerializer.writeProperty(ObjectFieldSerializer.java:111)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.JavaBeanSerializer.write(JavaBeanSerializer.java:180)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.ListSerializer.write(ListSerializer.java:126)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.serializer.JSONSerializer.write(JSONSerializer.java:330)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.JSON.toJSONString(JSON.java:383)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.alibaba.fastjson.JSON.toJSONString(JSON.java:371)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.pro.bw.lestore.AppManager.getAppList(AppManager.java:165)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.pro.bw.browser.parser.AmsRegistClientParser.parse(AmsRegistClientParser.java:43)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.pro.bw.common.async_http.AbstractRequester.doInBackground(AbstractRequester.java:99)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at com.pro.bw.common.async_http.AbstractRequester.doInBackground(AbstractRequester.java:1)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at android.os.AsyncTask$2.call(AsyncTask.java:287)
08-15 18:26:47.010: E/AndroidRuntime(684): 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
08-15 18:26:47.010: E/AndroidRuntime(684): 	... 5 more

加载中
0
wwwjjj
wwwjjj

list里的元素数量?

元素里面是否存在循环引用?

0
wenshao
wenshao
list中有一个对象的属性数据byte[],内容可能比较大,你自己检查一下。
返回顶部
顶部