roc230 / spymemcached

Automatically exported from code.google.com/p/spymemcached
0 stars 0 forks source link

Memory leaks #160

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've got the next problem during stoping tomcat.

SEVERE: The web application [/todo] appears to have started a thread named 
[Memcached IO over {MemcachedConnection to localhost/127.0.0.1:11211}] but has 
failed to stop it. This is very likely to create a memory leak.
25-Dec-2010 23:12:20 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads

Original issue reported on code.google.com by Alexander.Petrichkovich@gmail.com on 25 Dec 2010 at 9:55

GoogleCodeExporter commented 9 years ago
This leads to server is going down after few redeploys.

Original comment by Alexander.Petrichkovich@gmail.com on 25 Dec 2010 at 9:57

GoogleCodeExporter commented 9 years ago
Did you actually attempt to shut down the client when you were done with it?

Original comment by dsalli...@gmail.com on 25 Dec 2010 at 11:40

GoogleCodeExporter commented 9 years ago
I tried to stop tomcat by
catalina stop

Original comment by Alexander.Petrichkovich@gmail.com on 26 Dec 2010 at 1:14

GoogleCodeExporter commented 9 years ago
You wrote code that creates a MemcachedClient object.  Did you also write code 
to call .shutdown() on that object when it is no longer needed?  If not, that's 
what the above is complaining about.

Original comment by dsalli...@gmail.com on 26 Dec 2010 at 1:17

GoogleCodeExporter commented 9 years ago
Hmm, I'm thinking how to catch a moment (when tomcat is stoping web 
application) and call .shutdown()...

Original comment by Alexander.Petrichkovich@gmail.com on 26 Dec 2010 at 1:32

GoogleCodeExporter commented 9 years ago
The way to use every time a new instance of memcached client is not ideal.

Original comment by Alexander.Petrichkovich@gmail.com on 26 Dec 2010 at 1:38

GoogleCodeExporter commented 9 years ago
Whatever application hook you used to set it up surely has a similar hook to 
tear it down.  I do this in my own applications with a ServletContext.

I'm going to close this as a bug.  We can continue the conversation, but the 
functionality is present to do this.

Original comment by dsalli...@gmail.com on 26 Dec 2010 at 2:11