A fast object pool for the JVM
Stormpot 3.1 is fully backwards compatible with 3.0, but adds a number of new features:
This is a patch-release that fixes a bug where explicitly expired objects would not get to be deallocated by the configured allocator, when the pool was shut down. #135
This is a patch-release that fixes a bug where explicitly expired objects would not get to be deallocated by the configured allocator, when the BlazePool
was shut down. #135
Major release.
Pool.from(allocator).build()
.Pool.of(...)
API to create a pool with pre-allocated objects, and no background thread.This is a bug-fix release, that fixes a couple of cases where the background thread could get stuck at 100% CPU usage when objects are explicitly expired, or the pool is shrunk while there are poisoned slots.
Performance release.
Slot.release
in the BlazePool
implementation, by making it do a lazySet
of the slot status, instead of a compareAndSet
.Slot.expire
method, if they are discovered to have expired after they were claimed.CompoundExpiration
that can combine two expiration policies.Feature release:
ThreadFactory
that the pool can use for creating its background allocation thread.InterruptedException
is thrown from the allocators allocate()
or reallocate()
methods.Lots of incremental improvements:
claim()
calls more than once.Allocator
could eat the interrupt that was meant to signal to the allocation thread that it should begin shutting down. This signal is now no longer missed.claim()
call before they can be reallocated.Expiration.hasExpired()
is now allowed to throw exceptions.Reallocator
API has been added. It can potentially reduce old-gen garbage accretion, in cases where Poolable instances can be reused across deallocate/allocate calls.TimeSpreadExpiration
has been added and made the default Expiration. It prevents all slots in the pool from expiring all at once.New and very fast BlazePool implementation.