commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Fong (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (JCS-177) CompositeCacheManager leaks memory if CacheAccess.dipose is called
Date Fri, 05 May 2017 15:52:04 GMT

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

Ryan Fong edited comment on JCS-177 at 5/5/17 3:51 PM:
-------------------------------------------------------

I have attached one possible solution that should fix this problem as jcs-177.patch. An alternative
to this is to have a pointer from CompositeCache to CompositeCacheManager so we do not incur
the overhead of incrementing and decrementing the client count.

Also find an Eclipse project that uses stock 2.1 to demonstrate how the leak occurs and how
CompositeCacheManager.freeCache avoids this issue.

Update:
I just discovered that auxiliaryCaches is leaking as well. I have updated the patch and test
with a suggestion but did not compile it.


was (Author: rpmcfong):
I have attached one possible solution that should fix this problem as jcs-177.patch. An alternative
to this is to have a pointer from CompositeCache to CompositeCacheManager so we do not incur
the overhead of incrementing and decrementing the client count.

Also find an Eclipse project that uses stock 2.1 to demonstrate how the leak occurs and how
CompositeCacheManager.freeCache avoids this issue.

Update:
I just discovered that auxiliaryCaches is leaking as well. I can update the files later with
an updated suggestion.

> CompositeCacheManager leaks memory if CacheAccess.dipose is called
> ------------------------------------------------------------------
>
>                 Key: JCS-177
>                 URL: https://issues.apache.org/jira/browse/JCS-177
>             Project: Commons JCS
>          Issue Type: Bug
>          Components: Composite Cache
>    Affects Versions: jcs-2.1
>            Reporter: Ryan Fong
>            Priority: Critical
>         Attachments: jcs-177.patch, jcs-test.zip
>
>
> In JCS 2.1, The org.apache.commons.jcs.engine.control.CompositeCacheManager holds onto
a reference of CacheAccess in its caches map. If CacheAccess.dispose is called, this reference
is not cleaned up which results in a memory leak.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message