Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 78e592b8 authored by Chris Narkiewicz's avatar Chris Narkiewicz
Browse files

Increase maximum number of allowed connections in HTTP connection pool



Not all requests release connections, which leads to connection
pool starvation and lock-ups during files upload.

Apache's HTTP client handles "lost" connections by a GC
hook and removes unreachable objects from the pool.

However, this mechanism requires actual GC to occur, which
may not happen if the app is otherwise idle.

One way of observing this problem is to:
1) start upload of ~30 decently sized photos (few mbytes)
2) hang round in Uploads screen and observe progress bars
3) stop the app using debugger and observe FileUploaderThread
   being blocked in MultiThreadedHttpConnectionManager.doGetConnection()
   (calling wait())
4) when upload stalls, force GC using Android Studio profiler; this
   should unblock the connection pool and resume uploads

Increasing maximum number of allowed connections gives
more room for GC to kick in and reclaim stale connections,
which in turn should greatly improve stability of multi-file
uploads.

Other method would be to walk around the app, causing memory
allocations and triggering a GC as a side effect.

Signed-off-by: default avatarChris Narkiewicz <hello@ezaquarii.com>
parent 06cbb0d2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment