[ 
https://issues.apache.org/jira/browse/JCS-161?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15273548#comment-15273548
 ] 

Ryan Fong edited comment on JCS-161 at 5/6/16 3:17 PM:
-------------------------------------------------------

This also appears to affect 
org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCache<K, V>. We should 
probably apply a similar fix to all auxiliary cache implementations.

One additional related problem I noticed is that the BlockDiskCacheManager does 
not remove references to auxiliary caches (its cache map field) upon dispose so 
we have yet another strong reference that prevents reclaiming memory.


was (Author: rpmcfong):
This also appears to affect 
org.apache.commons.jcs.auxiliary.disk.block.BlockDiskCache<K, V>. We should 
probably apply a similar fix to all auxiliary cache implementations.

One additional related problem I noticed is that the BlockDiskCacheManager does 
not remove references to auxiliary caches upon dispose so we have yet another 
strong reference that prevents reclaiming memory.

> dynamic regions leak memory upon dispose due to ShrinkerTask
> ------------------------------------------------------------
>
>                 Key: JCS-161
>                 URL: https://issues.apache.org/jira/browse/JCS-161
>             Project: Commons JCS
>          Issue Type: Bug
>          Components: Composite Cache
>    Affects Versions: jcs-2.0-beta-1
>            Reporter: Ryan Fong
>            Priority: Critical
>
> Creating a dynamic region via JCS.defineRegion and then destroying it via 
> ComposeCacheManager.free does not fully reclaim all memory when the memory 
> shrinker is enabled.
> When shrinking is enabled, the 
> org.apache.commons.jcs.engine.memory.shrinking.ShrinkerThread retains a 
> pointer to CompositeCache which is never reclaimed.
> A simple solution would be to have 
> org.apache.commons.jcs.engine.control.CompositeCache.setScheduledExecutorService(ScheduledExecutorService)
>  retain the ScheduledFuture as a field. When CompositeCache.disposed is 
> called, we should call ScheduledFuture.cancel.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to