Closed swimmesberger closed 7 years ago
@swimmesberger, sorry for my slow reply. The pool has a limit of max number of objects set to Integer.MAX_VALUE - 4096. This is not included in the javadoc, I'll include it there in the next release which should be soon.
However, having a pool with such very big max size is probably not a good idea, think about it like this, Integer.MAX_VALUE is ~2G, if one of the objects you keep in the pool has size of ~1000 bytes, then you'll need ~2TB RAM in order to keep the pool in memory. Even if your object are ~100 bytes each, you'll still need ~200GB RAM for it. Probably, the max size of the pool shouldn't be larger then, say, 10K or 100K, presuming that these are expensive to create objects.
When I'm closing the pool after usage following exception is thrown:
Pool Creation: