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

haruhiko nishi edited comment on OGNL-228 at 12/13/12 2:47 PM:
---------------------------------------------------------------

There are indeed other DelegatingClassLoaders also observed in the heap dump, 
as other frameworks also uses reflective method calls. 
However, there is difference. I see no "other classloader" between the 
Thread(GC root) and the DelegatingClassLoader. For instance, 
DelegatingClassLoaders which is created upon reflective call made by an object 
returned by DefaultListableBeanFactory of springframework has the GC root of a 
Thread which probably terminates only when JBoss is shutdown. 
In the ognl.OgnlRuntime case, if its GC root, which probably is a request 
Thread, would have called a method reflectively in more "direct" manner, the 
DelegatingClassLoader holding sun.reflect.GeneratedMethodAccessorXXX could be 
expelled eventually. However, as this is done though ognl.OgnlRuntime loaded by 
org.jboss.classloader.spi.base.BaseClassLoader, which has a different GC root, 
the sun.reflect.GeneratedMethodAccessorXXX remains, because the 
ognl.OgnlRuntime holds them in its HashMap. 
My analyzation may be wrong, but the old post at 
http://grokbase.com/t/struts/user/0948kcdd77/struts-and-permgen-errors-with-ognl-method-param
 says, "new ones keep coming in almost on every request (as far as I can tell, 
refreshing a page almost always triggers new ones)." 
                
      was (Author: hanishi):
    There are indeed other DelegatingClassLoaders also observed in the heap 
dump, as other frame works also uses reflective method calls. 
However, there is difference. I see no "other classloader" between the 
Thread(GC root) and the DelegatingClassLoader. For instance, 
DelegatingClassLoaders which is created upon reflective call made by an object 
returned by DefaultListableBeanFactory of springframework has the GC root of a 
Thread which probably terminates only when JBoss is shutdown. 
In the ognl.OgnlRuntime case, if its GC root, which probably is a request 
Thread, would have called a method reflectively in more "direct" manner, the 
DelegatingClassLoader holding sun.reflect.GeneratedMethodAccessorXXX could be 
expelled eventually. However, as this is done though ognl.OgnlRuntime loaded by 
org.jboss.classloader.spi.base.BaseClassLoader, which has a different GC root, 
the sun.reflect.GeneratedMethodAccessorXXX remains, because the 
ognl.OgnlRuntime holds them in its HashMap. 
My analyzation may be wrong, but the old post at 
http://grokbase.com/t/struts/user/0948kcdd77/struts-and-permgen-errors-with-ognl-method-param
 says, "new ones keep coming in almost on every request (as far as I can tell, 
refreshing a page almost always triggers new ones)." 
                  
> Is ognl.OgnlRuntime some root cause of PermGen OutOfMemoryError problem?
> ------------------------------------------------------------------------
>
>                 Key: OGNL-228
>                 URL: https://issues.apache.org/jira/browse/OGNL-228
>             Project: Commons OGNL
>          Issue Type: Bug
>         Environment: RHEL 6 x64
>            Reporter: haruhiko nishi
>            Priority: Critical
>              Labels: OutOfMemoryError
>
> While analyzing several heap dumps using Yourkit, we have observed many 
> instances of DelegatingClassLoader, or more precisely 
> sun.reflect.GeneratedMethodAccessorXXX, where XXX represents some sequential 
> numbers, were created through the usage of Java reflection by the frameworks 
> implemented in our web application.
> GeneratedMethodAccessorXXX is allegedly used for some sort of reflection 
> optimization mechanism according to the url at 
> http://www-01.ibm.com/support/docview.wss?uid=swg21566549.
> Because this is what seems to be eating up our memory allocated for PermGen, 
> as the number of the DelegatingClassLoader is gradually increased and JVM 
> crushes with OutOfMemoryError, we scrutinized what is possibly blocking these 
> DelegatingClassLoaders from being garbage collected and found many of them 
> are relevant to _methodParameterTypesCache of ognl.OgnlRuntime.
> Is there any known problems regarding this issue?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to