简体   繁体   中英

tomcat shutdown memory leak, java thread can not stop

all: here is my problem: when I use shundown.bat to close tomcat, but it's failed,and here some logs:

Severe: The web application [/shop] appears to have started a thread named [ConnectionStateManager-0] but has failed to stop it. This is very likely to create a memory leak.

2013-10-22 11:38:10 org.apache.catalina.loader.WebappClassLoader clearReferences

Severe: The web application [/shop] appears to have started a thread named [CuratorFramework-0] but has failed to stop it. This is very likely to create a memory leak.

From the log we can know it's may be some Thread can not stop,and may cause memeory leak;

dose anyone see this before or someone can give some soultions,thank you

Well, if you are shutting down tomcat, it doesn't matter if some thread wont stop. Once the java process ends, each thread will die and the memory will be free.

Just take care that java process does not hang, maybe you can add the kill rule in shutdown.bat calling it with -force (refer to tomcat manual for it, i'm not windows aware), or just check for it from your task manager.

Hope it hepls

PS Since I remember I always had those log lines in my environments, but I never had any trouble with them.

It might be best if you direct that question to the creator of that Shop Servelet, only he/she knows for sure.

A Servlet is supposed to be stateless, but it doesn't have to be. However if you break out of that stateless system (in this case by keeping a special Thread alive), TomCat can no longer ensure that the cleanup will be done properly, hence the warning. Therefore this can be an issue, but doesn't have to be, if coded correctly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM