[
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-314?pag...
]
Emmanuel Bernard commented on HSEARCH-314:
------------------------------------------
I still don't fully understand what is going on.
We already use a WeakHashMap (as in weak key) and while SearchFactoryImpl does get a
reference to Configuration it does not keep it AFAIK. So at the end of the constructor
execution, SFI no longer have any reference to Configuration. The Configuration should
then be released from the map provided that Configuration is not referenced anywhere
else.
If SearchFactoryImpl keeps a reference to Configuration, that's a bug and needs to be
fixed.
Also in SearchFactoryImpl.close(), we can go a clear the ContextHolder. Not sure this will
help but if the app is properly undeployed it will. We will need to add a ContextHolder
method clearing the map by value.
ThreadLocal in ContextHolder causes memory leak when deployed in a
web container
--------------------------------------------------------------------------------
Key: HSEARCH-314
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-314
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.1.0.CR1
Environment: Hibernate 3.3.1.GA Tomcat 6.0.18 Spring 2.5.6 Java OpenJDK 1.6
Reporter: François Terrier
Fix For: 3.1.1
The SearchFactory has a static ThreadLocal variables which holds a reference to the
SearchFactoryImpl. The ThreadLocal is not cleared when the application is undeployed,
causing a memory leak.
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira