Skip to content

avoid sub-classing ThreadLocal since it will leak in envs such as .wars#1772

Merged
enebo merged 1 commit intojruby:jruby-1_7from
kares:thread-local-leak-1_7
Jul 9, 2014
Merged

avoid sub-classing ThreadLocal since it will leak in envs such as .wars#1772
enebo merged 1 commit intojruby:jruby-1_7from
kares:thread-local-leak-1_7

Conversation

@kares
Copy link
Member

@kares kares commented Jun 27, 2014

e.g. on Tomcat a Warbled up with this change (tested 1.7.13) allows to avoid the following warning(s) :

INFO: Undeploying context [/hellowarld]
Jun 27, 2014 9:08:32 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/hellowarld] created a ThreadLocal with key of type [org.jruby.util.Sprintf$2] (value [org.jruby.util.Sprintf$2@7cd67450]) and a value of type [java.util.HashMap] (value [{en_US=java.text.DecimalFormatSymbols@1073a}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jun 27, 2014 9:08:32 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/hellowarld] created a ThreadLocal with key of type [org.joni.StackMachine$1] (value [org.joni.StackMachine$1@636e7037]) and a value of type [java.lang.ref.WeakReference] (value [java.lang.ref.WeakReference@67895de0]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Jun 27, 2014 9:08:32 AM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks

related issue at jruby/joni#11

…rbled) .war apps

due JRuby classes being loaded from the (WEB-INF/lib) application loader ...
prevents such applications from correctly releasing class memory (e.g. on re-deploys)
enebo added a commit that referenced this pull request Jul 9, 2014
avoid sub-classing ThreadLocal since it will leak in envs such as .wars
@enebo enebo merged commit 3159a5c into jruby:jruby-1_7 Jul 9, 2014
@enebo enebo modified the milestone: JRuby 1.7.14 Jul 9, 2014
@enebo
Copy link
Member

enebo commented Jul 9, 2014

In the future could you not auto-whitespace fix your PRs? It made seeing the diff more difficult (and I did not want to fetch to see -iw output).

@kares
Copy link
Member Author

kares commented Jul 9, 2014

thanks @enebo sure will try to not forget - although my editor is setup that way ;( ... as I was messing up
p.s. there's a secret called ?w=1 kares@ce855b4e885cfc?w=1

@enebo
Copy link
Member

enebo commented Jul 9, 2014

Awesome... w=1 will make me never complain about this again :)

On Wed, Jul 9, 2014 at 12:20 PM, Karol Bucek notifications@github.com
wrote:

thanks @enebo https://github.com/enebo sure will try to not forget -
although my editor is setup that way ;( ... as I was messing up
p.s. there's a secret called ?w=1
kares@ce855b4e885cfc?w=1


Reply to this email directly or view it on GitHub
#1772 (comment).

blog: http://blog.enebo.com twitter: tom_enebo
mail: tom.enebo@gmail.com

@enebo
Copy link
Member

enebo commented Jul 9, 2014

Assuming I remember it.

On Wed, Jul 9, 2014 at 12:34 PM, Thomas E Enebo tom.enebo@gmail.com wrote:

Awesome... w=1 will make me never complain about this again :)

On Wed, Jul 9, 2014 at 12:20 PM, Karol Bucek notifications@github.com
wrote:

thanks @enebo https://github.com/enebo sure will try to not forget -
although my editor is setup that way ;( ... as I was messing up
p.s. there's a secret called ?w=1
kares@ce855b4e885cfc?w=1


Reply to this email directly or view it on GitHub
#1772 (comment).

blog: http://blog.enebo.com twitter: tom_enebo
mail: tom.enebo@gmail.com

blog: http://blog.enebo.com twitter: tom_enebo
mail: tom.enebo@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants