Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jul 9, 2014

Conversation

Projects
None yet
2 participants
@kares
Copy link
Member

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

avoid sub-classing ThreadLocal since it will leak in envs such as (wa…
…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

Merge pull request #1772 from kares/thread-local-leak-1_7
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

1 check failed

continuous-integration/travis-ci The Travis CI build failed
Details

@enebo enebo modified the milestone: JRuby 1.7.14 Jul 9, 2014

@enebo

This comment has been minimized.

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

This comment has been minimized.

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@ce855b4?w=1

@enebo

This comment has been minimized.

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@ce855b4?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

This comment has been minimized.

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@ce855b4?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
You can’t perform that action at this time.