Once it is activated it keeps a thread running forever.
Instead: we shut down the timer when it is empty, or when the CachePool it relates to is empty. (Which means we have to restart it appropriately, too.)
Also we can try using an ExecutorService instead of a Timer.
There is a static Timer used to purge CachePools.
Once it is activated it keeps a thread running forever.
Instead: we shut down the timer when it is empty, or when the CachePool it relates to is empty. (Which means we have to restart it appropriately, too.)
Also we can try using an ExecutorService instead of a Timer.