joshdholtz / Sentry-Android

[Deprecated] Use official "raven-java" library
https://github.com/getsentry/sentry-java
MIT License
180 stars 48 forks source link

Use fixed resources for sending #80

Closed marcomorain closed 8 years ago

marcomorain commented 8 years ago

Introduce 2 limits on the resources used.

Use an Executor with a thread pool of max size 1 for sending HTTP requests to Sentry. This thread pool will use 0 threads at idle, and reduce the number of threads in use down to 0 after a minute of no exceptions.

Use a fixed queue for events. A queue of up to 50 events will be queued for sending to Sentry. If more than 50 events are queued, the new events will be discarded.

These two changes will add a fixed ceiling to the amount of resources the Sentry client will use on the device.

marcomorain commented 8 years ago

@joshdholtz this will reduce the amount of resources used by the client.

This moves processing off the async task thread pool so the Sentry client won't block the app.