"Outofmemoryerror" error using Volley

Asked

Viewed 99 times

1

I’m making an application where I have a URL that returns a JSON, through the Volley library, I’m taking the content of this URL and turning into string, this process shall be carried out on each 5 seconds, after a certain period my application generated the following error:

java.lang.Outofmemoryerror at com.android.Volley.toolbox.Diskbasedcache.streamToBytes(Diskbasedcache.java:322) at com.android.Volley.toolbox.Diskbasedcache.readString(Diskbasedcache.java:540) at com.android.Volley.toolbox.Diskbasedcache.readStringStringMap(Diskbasedcache.java:562) at com.android.Volley.toolbox.Diskbasedcache$Cacheheader.readHeader(Diskbasedcache.java:403) at com.android.Volley.toolbox.Diskbasedcache.initialize(Diskbasedcache.java:156) at com.android.Volley.CacheDispatcher.run(Cachedispatcher.java:84)

What can I do to fix this?

I’m using the method GET RequestQueue of the Volley library.

  • This looks like a Leak memory. Could you scan the memory monitor (this in Android Studio)? Something else, it could include the code that makes this request?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.