android - Volley memory leak on HEAD requests -


Regarding the volley library for Android:

All head requests, my device will run out of memory quickly. Why it seems that it allocates memory based on volumes content in HEAD requests, for example in line 212

new poolingbatteryreutputstream (mPool, (entity) entity.getContentLength ());

What am I doing:

  requestkey mRequestQueue = Volley.newRequestQueue (this); For (link: different_links_of_mp3_files) {StringRequest req = New StringRequest (Method.HEAD, URL, blank); MRequestQueue.add (req)   

Is anyone experiencing the same problem? Is this a bug or just my mistake? Thanks in advance.

I have managed to fix it myself, this is a library bug if someone has the same If there is a problem, you will need to add the following additional IF statements to line

  // if the request method is prominent, then there is no need to assign / memory if (request .getMethod () == Request method.HEAD) {responseContents = new byte [0]; } // Some responses such as 204s do not have content, we must check // and if (httpResponse.getEntity ()! = Null) {responsiveContents = entityToBytes (httpResponse.getEntity ()); } else {0} Add 0 byte feedback as a way to represent the honest request of e-content request feedback = new byte [0]; }   

By doing this, the volley no longer allocates more content-length memory, thanks to anyway if anyone has tried not to give me any results.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -