chrisvest / stormpot

A fast object pool for the JVM
http://chrisvest.github.io/stormpot/
Apache License 2.0
350 stars 41 forks source link

Fix pool shrinking with new allocations #160

Closed chrisvest closed 3 months ago

chrisvest commented 3 months ago

Make BAllocThread.reduceSizeByDeallocating() call refill on the disregardPile and the newAllocations. Otherwise, the pool might not be able to deallocate objects allocated but unused prior to a new target size being set. This is normally not a big deal for pools that have any sort of activity, but the ThreadedPoolTest.decreasingSizeMustNotDeallocateTlrClaimedObjects test could end up in an infinite loop, and break the build.