[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4317) Memory leak in EnumType class.

Ondrej Medek (JIRA) noreply at atlassian.com
Thu Jan 21 09:40:30 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4317?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35293#action_35293 ] 

Ondrej Medek commented on HHH-4317:
-----------------------------------

IMO soft reference is not good, weak reference should be used. Maybe it has to be a map with weak keys and values, too. 

BTW. I do not understand the core of Hibernate, but why this static map exists? Would be enough to cache the values in a simple instance variable: private Object[] enumValues?

> Memory leak in EnumType class.
> ------------------------------
>
>                 Key: HHH-4317
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4317
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: annotations
>            Reporter: Paweł Kępka
>            Priority: Critical
>
> Holding enum values in static enumValues map in EnumType class causes memory leaks on application server where hibernate is loaded by application server's common classloader (like for default configuration of JBoss4).
> SoftReference or SessionFactory based caching should be used instead. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list