排球的OutOfMemoryError

排球的OutOfMemoryError

本文介绍了排球的OutOfMemoryError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们得到了内存不足的错误凌空库里面,而解析网络响应。这发生在蹩脚的手机大的反应。这个问题能避免?有没有办法告诉凌空解析分批反应可能?

We're getting an OutOfMemory error inside the Volley library while parsing the network response. This occurs with a large responses on crappy phones. Can this be avoided? Is there any way to tell Volley to parse the response in batches maybe?

下面是例外:

07-18 14:33:41.449    6130-6154/com.tinder E/AndroidRuntime: FATAL EXCEPTION: Thread-22
    java.lang.OutOfMemoryError
    at java.lang.String.<init>(String.java:325)
    at java.lang.String.<init>(String.java:276)
    at com.android.volley.toolbox.JsonObjectRequest.parseNetworkResponse(JsonObjectRequest.java:66)
    at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:116)

这发生在对Droid X(2.3.4)。

This occurs on the Droid X (2.3.4).

推荐答案

因此​​,为了解决这个问题,我切换到使用通用的HttpConnection和JsonReader解析输入流。但愿有人会加重乱射,并使其返回JsonReader ...也许这将是我...我丰富的业余时间......

So, in order to solve this, I switched to using a generic HttpConnection and JsonReader to parse the input stream. Hopefully, somebody will add to Volley and enable it to return a JsonReader ... maybe it will be me ... in my copious spare time ...

这篇关于排球的OutOfMemoryError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 22:16