GPars shutdown/cleanup in a tomcat web application?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GPars shutdown/cleanup in a tomcat web application?

Marcel Wagner
We use GPars in a spring web application running in tomcat. On tomcat
shutdown we get two kinds of errors:

1) The web application appears to have started a thread named
[GParsExecutorsTimeoutTimer] but has failed to stop it. This is very
likely to create a memory leak.

2) The web application created a ThreadLocal with key of type
[groovyx.gpars.ThreadLocalPools] (value
[groovyx.gpars.ThreadLocalPools@64969762]) and a value of type
[java.util.LinkedList] (value [[]]) 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.

We use only the gpars feature:
         withPool {  executeAsyncAndWait( ... ) }

What can we do about the correct shutdown of GPars in the spring/tomcat
context? Is there a way to shutdown GPars? Cleanup the
GParsExecutorsTimeoutTimer Thread, the ThreadLocal? We have to do the
same for example with the JDBC driver, in a ServletContextListener on
shutdown.

Regards,
Marcel

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: GPars shutdown/cleanup in a tomcat web application?

Vaclav
Administrator
Hi Marcel,

these resources cannot be currently cleaned up, AFAIK. We'll need to address timers' and thread locals's shutdown in the next version, I suspect.

Best regards,

Vaclav



On Mon, Jan 13, 2014 at 10:58 AM, Marcel Wagner <[hidden email]> wrote:
We use GPars in a spring web application running in tomcat. On tomcat shutdown we get two kinds of errors:

1) The web application appears to have started a thread named [GParsExecutorsTimeoutTimer] but has failed to stop it. This is very likely to create a memory leak.

2) The web application created a ThreadLocal with key of type [groovyx.gpars.ThreadLocalPools] (value [groovyx.gpars.ThreadLocalPools@64969762]) and a value of type [java.util.LinkedList] (value [[]]) 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.

We use only the gpars feature:
        withPool {  executeAsyncAndWait( ... ) }

What can we do about the correct shutdown of GPars in the spring/tomcat context? Is there a way to shutdown GPars? Cleanup the GParsExecutorsTimeoutTimer Thread, the ThreadLocal? We have to do the same for example with the JDBC driver, in a ServletContextListener on shutdown.

Regards,
Marcel

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
E-mail: [hidden email]
Blog: http://www.jroller.com/vaclav
Linkedin page: http://www.linkedin.com/in/vaclavpech