-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear Memory occupied by volley request queue #220
Comments
Are you really sure you need multiple request queues? Have you observed a bottleneck from using a single queue? I'm surprised that you would find that multiple queues would help you here rather than (say) increasing the size of the NetworkDispatcher thread pool, if in fact your network threads were being used up. But it'd be good to know where the bottleneck actually is. In any case, RequestQueue#stop will shut down all of the underlying threads, which should free up nearly all of the memory used by a queue. |
Thanks for your fast reply. Actually my application needs to send about 5 to 10 requests to my single iot device in a second when the user is interacting with the device. I started from using default httpurlconnection inside asyntask but it was slow and queued up consecutive commands, waited for the first command to be finished off before the next one could be processed.
i'm looking for a better way to clean up resources and memory occupied by volley's request handler. That will save me the time for looking for a new http request handler. |
Not sure there's much I can offer from the Volley side - all we can do is stop the threads. Longer term, we're hoping to work on an asynchronous architecture that will scale better for large numbers of parallel requests - see #181. Unfortunately I can't offer an ETA on that or anything. I will say that from my own experience, seeing pthread_create issues may not actually be due to being out of memory per se. IIRC Nexus 5X and 6P have a bug that causes pthread_create to fail even when there should be plenty of memory. Not sure if other devices might have similar issues. |
I have an android application in which I need multiple volley request queue's to be maintained for different iot devices. My app needs to communicate with each iot device on separate request queue for faster response.
But because I have new request queue being created for each new iot device object, my app is going out of memory.
I want to clear the memory occupied by previous request queue..
Is it possible by any means??
The text was updated successfully, but these errors were encountered: