- Notifications
You must be signed in to change notification settings - Fork309
Use ForkJoinPool and provide builder API to limit threads count.#1092
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
greenrobot-team commentedAug 16, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks! Maybe we should also consider setting the maximum size to 64 (but at least number of processors) by default. (It's the default parallelism number for Kotlin's IO scheduler.) |
Hi! I like the idea of having sane default limit to number of threads in pool. |
@mstyura Oh sorry, I didn't mean for you to implement this. With "we" I meant the ObjectBox team. But thanks for the investigation! |
This PR provide API to configure thread pool limits use by
BoxStore
.I was observed situation in
Android
application where (due to some other issues in app) application is crashed withOOM
. At the moment of crash there were tens of alive threads belong toObjectBox
pool. The numbering suggest that thousands of thread were already created and destroyed by the pool at the moment of crash.So it would be nice to have an API to limit number of threads allowed in thread pool and minimum number of threads as well.
This of course will not solve original problem with app I was debugging, but will probably help to reveal root problem earlier.