[jira] Created: (TOMAHAWK-1464) PermGen OutOfMemoryError caused by UploadedFile

View: New views
3 Messages — Rating Filter:   Alert me  

[jira] Created: (TOMAHAWK-1464) PermGen OutOfMemoryError caused by UploadedFile

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

PermGen OutOfMemoryError caused by UploadedFile
-----------------------------------------------

                 Key: TOMAHAWK-1464
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1464
             Project: MyFaces Tomahawk
          Issue Type: Bug
          Components: File Upload
         Environment: myfaces-extensions-1.0.9.jar
Sun Java System Application Server 9.1_02 (build b04-fcs)
JDK 1.6.0_11
            Reporter: Hans Cappelle


After redeploying a simple myfaces project with tomahawk extension the application server crashes with OutOfMemoryError: PermGen space. Using jmap and jhat I discovered serveral classloaders with a reference to an instances of org.apache.myfaces.custom.fileupload.UploadedFile were left in memory. Because of this classloaders can't shut down properly so after several redeployments we get an OutOfMemory.

classloader hierarchy example (it states 2 classes are left because cleaning my test project also fails on a richfaces class):

                                        ^---- org.apache.catalina.loader.WebappClassLoader@0x1e26b260 [ 853 classes ]
                                                ^---- com.sun.faces.application.ConverterPropertyEditorFactory$DisposableClassLoader@0x1e27c788 [ 2 classes ]

One of the classes left is:

class com.sun.faces.application.ConverterPropertyEditorFor_org_apache_myfaces_custom_fileupload_UploadedFile (84 bytes) : ??

with a reference to:

class org.apache.myfaces.custom.fileupload.UploadedFile (84 bytes)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1464) PermGen OutOfMemoryError caused by UploadedFile

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/TOMAHAWK-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12771415#action_12771415 ]

Hans Cappelle commented on TOMAHAWK-1464:
-----------------------------------------

This representation of classloader and classes is easier to read:

Class Name                                                                              | Shallow Heap | Retained Heap
-----------------------------------------------------------------------------------------------------------------------
org.apache.catalina.loader.WebappClassLoader @ 0x1d440e10                               |          176 |        99.160
'- <classloader> class org.apache.myfaces.custom.fileupload.UploadedFile @ 0x341b5c70   |            0 |             0
   '- key java.util.Hashtable$Entry @ 0x1d44e950                                        |           24 |            48
      '- [1] java.util.Hashtable$Entry[47] @ 0x1d5dfb58                                 |          200 |           728
         '- table java.util.Hashtable @ 0x1c6ff480                                      |           40 |           768
            '- registry class java.beans.PropertyEditorManager @ 0x32ecb2f0 System Class|            8 |           864
-----------------------------------------------------------------------------------------------------------------------


> PermGen OutOfMemoryError caused by UploadedFile
> -----------------------------------------------
>
>                 Key: TOMAHAWK-1464
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1464
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: File Upload
>         Environment: myfaces-extensions-1.0.9.jar
> Sun Java System Application Server 9.1_02 (build b04-fcs)
> JDK 1.6.0_11
>            Reporter: Hans Cappelle
>
> After redeploying a simple myfaces project with tomahawk extension the application server crashes with OutOfMemoryError: PermGen space. Using jmap and jhat I discovered serveral classloaders with a reference to an instances of org.apache.myfaces.custom.fileupload.UploadedFile were left in memory. Because of this classloaders can't shut down properly so after several redeployments we get an OutOfMemory.
> classloader hierarchy example (it states 2 classes are left because cleaning my test project also fails on a richfaces class):
>                                         ^---- org.apache.catalina.loader.WebappClassLoader@0x1e26b260 [ 853 classes ]
>                                                 ^---- com.sun.faces.application.ConverterPropertyEditorFactory$DisposableClassLoader@0x1e27c788 [ 2 classes ]
> One of the classes left is:
> class com.sun.faces.application.ConverterPropertyEditorFor_org_apache_myfaces_custom_fileupload_UploadedFile (84 bytes) : ??
> with a reference to:
> class org.apache.myfaces.custom.fileupload.UploadedFile (84 bytes)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TOMAHAWK-1464) PermGen OutOfMemoryError caused by UploadedFile

by My Faces - Dev mailing list :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


    [ https://issues.apache.org/jira/browse/TOMAHAWK-1464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12771421#action_12771421 ]

Hans Cappelle commented on TOMAHAWK-1464:
-----------------------------------------

See last remark at this ticket: https://issues.apache.org/jira/browse/XBEAN-95

java.beans.PropertyEditorManager keeps a strong reference to the registered classes. The xbean PropertyEditor classes are loaded by the context class loader, (which is the webapp class loader if running in Tomcat etc.). The class java.beans.PropertyEditorManager is loaded by the bootstrap class loader. This means that there is a strong reference from the bootstrap class loader to the webapp class loader, which means that the webapp class loader cannot be unloaded, which means that the webapp is not garbage collected when it is undeployed.

> PermGen OutOfMemoryError caused by UploadedFile
> -----------------------------------------------
>
>                 Key: TOMAHAWK-1464
>                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1464
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>          Components: File Upload
>         Environment: myfaces-extensions-1.0.9.jar
> Sun Java System Application Server 9.1_02 (build b04-fcs)
> JDK 1.6.0_11
>            Reporter: Hans Cappelle
>
> After redeploying a simple myfaces project with tomahawk extension the application server crashes with OutOfMemoryError: PermGen space. Using jmap and jhat I discovered serveral classloaders with a reference to an instances of org.apache.myfaces.custom.fileupload.UploadedFile were left in memory. Because of this classloaders can't shut down properly so after several redeployments we get an OutOfMemory.
> classloader hierarchy example (it states 2 classes are left because cleaning my test project also fails on a richfaces class):
>                                         ^---- org.apache.catalina.loader.WebappClassLoader@0x1e26b260 [ 853 classes ]
>                                                 ^---- com.sun.faces.application.ConverterPropertyEditorFactory$DisposableClassLoader@0x1e27c788 [ 2 classes ]
> One of the classes left is:
> class com.sun.faces.application.ConverterPropertyEditorFor_org_apache_myfaces_custom_fileupload_UploadedFile (84 bytes) : ??
> with a reference to:
> class org.apache.myfaces.custom.fileupload.UploadedFile (84 bytes)

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.