Skip to content
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

Thread Pool size #136

Open
PedroMPagani opened this issue Aug 16, 2022 · 4 comments
Open

Thread Pool size #136

PedroMPagani opened this issue Aug 16, 2022 · 4 comments

Comments

@PedroMPagani
Copy link

Hey, the async option from the Executors doesn't limit the number of threads that can be used in the pool, users have to be very careful when using that to not get an out of memory, a proper usage of it would be to limit the number of threads.

@connorruesch
Copy link
Contributor

If I’m not mistaken helper’s asynchronous executor uses a cached thread pool which should remove unused threads after a certain period of time. So unless you’re running an extremely large number of long and intensive tasks, it should be fine.

@PedroMPagani
Copy link
Author

You're not mistaken, that is correct, but when executing many things at the same time will end up in our of memory, don't you think that there should be a max limit? Specially for developers, people tend to think that just running async will fix any lag issue.

@conclube
Copy link

Perhaps just give callers the choice of dropping their own executor instance if wanted to? Similarly to how CompletableFuture allows it with its factory methods CompletableFuture::runAsync and CompletableFuture::supplyAsync.

@PedroMPagani
Copy link
Author

That sounds more like an open idea, good thinking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants