Zoran Regvart created CAMEL-10732:
-------------------------------------

             Summary: Remove from all caches when Groovy script is removed from 
Camel script cache
                 Key: CAMEL-10732
                 URL: https://issues.apache.org/jira/browse/CAMEL-10732
             Project: Camel
          Issue Type: Bug
          Components: camel-groovy
    Affects Versions: 2.18.1, 2.17.4, 2.16.6
            Reporter: Zoran Regvart
            Assignee: Zoran Regvart


Camel's GroovyLanguage maintains a cache of Groovy class scripts up to maximum 
of 1000 entries. When the limit of 1000 entries is reached the LRU cache 
removes the least used ones.
The LRU cache removes only the Script classes it does not remove all the 
references that still remain to that class and this causes a memory leak.
The remaining references are in Groovy metaclass registry, Groovy ClassInfo 
reflection support cache and Java Beans Introspector cache.
All of these can be easily removed on removal from the Camel LRU script cache 
by invoking {{org.codehaus.groovy.runtime.InvokerHelper.removeClass}}.

See [Groovy and Camel PermGen troubles with Java 
1.7|http://mail-archives.apache.org/mod_mbox/camel-users/201701.mbox/%3C1484927208612-5792865.post%40n5.nabble.com%3E]
 on the camel-users mailing list.



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

Reply via email to