Maximum "Threads" for HttpClient?

tchart

Well-Known Member
Licensed User
Longtime User
Hi,

I have an app in development which downloads images from a server and displays them on the device (covering the screen).

I recently purchased a Samsung Galaxy Tablet and the code which ran fine on a phone (480x800 pixels) is now returning an error on the tablet (1280x800 pixels). The error is complaining about the number of threads being exceeded when I call HttpClient Execute. I assume this is occurring due to the increased number of images required to cover the display real estate.

The actual error is;

java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.FutureTask@416c1370 rejected from java.util.concurrent.ThreadPoolExecutor@40821f30[Running, pool size = 20, active threads = 20, queued tasks = 0, completed tasks = 950]

From this I assume there is a limit to 20 concurrent "threads" or "downloads" in my case.

Has anyone else come across this?

Thanks
 

Roger Garstang

Well-Known Member
Licensed User
Longtime User
Shouldn't be. 20 Execution threads seems low too. I could see it for Network specific things- Non-Server based Windows machines limit TCP connections to control spread of viruses and limit what you can do with a machine so not able to use it as a server, etc. You don't gain too much once you get over 6-8 connections either for gain with additional threads/connections.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…