ERXThreadStorage memory leak
ERXThreadStorage memory leak
- Subject: ERXThreadStorage memory leak
- From: Alexis Tual <email@hidden>
- Date: Fri, 25 Apr 2014 16:39:44 +0200
Hello,
just wanted to share this bug with the community, in fact it's a java "bug" (or misconception) causing memory leaks :
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6501120
With wonder, if you use ERXThreadStorage and inheritable thread storage (the default), threads created later (even by third party libraries you don't even know) will inherit the threadlocal.
This can cause huge memory leaks, for example ERXSession.session() is based on ERXThreadStorage... (if you use WOInject with SessionScoped, you're in this case) so you will end up with some sessions not garbabe collected !
Solution : deactivate inheritable thread storage with er.extensions.ERXThreadStorage.useInheritableThreadLocal=false
... but then in your own threads you won't be able to retrieve anything from ERXThreadStorage :)
Cheers,
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden