Android 截击内存不足问题V1.1.0

Android 截击内存不足问题V1.1.0,android,android-volley,Android,Android Volley,我从截击中得到了这个记忆不足的问题。目前,我的 请求对象创建是这样的 if (reQuestQue == null) { reQuestQue = Volley.newRequestQueue(mContext); } reQuestQue.add(mGsonRequest);` 我得到一个例外: Fatal Exception: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed: Try again

我从截击中得到了这个记忆不足的问题。目前,我的 请求对象创建是这样的

if (reQuestQue == null) {
    reQuestQue = Volley.newRequestQueue(mContext);
}
reQuestQue.add(mGsonRequest);`
我得到一个例外:

Fatal Exception: java.lang.OutOfMemoryError: pthread_create (1040KB stack) failed:
Try again
           at java.lang.Thread.nativeCreate(Thread.java)
           at java.lang.Thread.start(Thread.java:1063)
           at com.android.volley.RequestQueue.start(RequestQueue.java:135)
           at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:91)
           at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:67)
           at com.android.volley.toolbox.Volley.newRequestQueue(Volley.java:102)`

我发现解决方案似乎是在HTTP模块中为每个请求重新创建请求队列。为了避免这种情况,我在模块中使用了以下单例类

`公共类请求单例{ 私有静态请求单态sSoleInstance; 私有静态RequestQueue reQuestQue

private RequestQueSingleton(){}  //private constructor.

public static RequestQueSingleton getInstance(Context context){
    if (sSoleInstance == null){ //if there is no instance available... create new one
        sSoleInstance = new RequestQueSingleton();
        reQuestQue = Volley.newRequestQueue(context);
    }

    return sSoleInstance;
}


public  synchronized RequestQueue getInstance() {
    Log.d("Request Que Obj",reQuestQue.hashCode()+"");
    return reQuestQue;
}}`

你的问题是什么?你需要清除缓存,截击库可以存储缓存,这是截击的主要回退。检查此项它可能会帮助你:尝试此答案@ZUNJAE我收到此异常,正在寻找修复方法