Amit
asked on
How to close Java Threads in servlets
Hi,
I am getting this warning in an java servlet application which is deployed on tomcat. I am creating threads to do scheduled task execution. But I am not destroying/stopping the threads in any part of the code as I don't know what't the best way to handle it in servlets without crashing the whole application or tomcat.
Please help how to prevent memory leaks so that I can run the app forever without being forced to restart the app all the time
thanks
-anshu
Nov 16, 2015 4:52:20 PM org.apache.catalina.core.S tandardCon text reload
INFO: Reloading Context with name [/abcd1234] has started
Nov 16, 2015 4:52:20 PM org.apache.catalina.loader .WebappCla ssLoaderBa se clearReferencesThreads
SEVERE: The web application [/abcd1234] appears to have started a thread named [pool-1-thread-1] but has failed to stop it. This is very likely to create a memory leak.
Nov 16, 2015 4:52:22 PM org.apache.catalina.startu p.TldConfi g execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Nov 16, 2015 4:52:22 PM org.apache.catalina.core.S tandardCon text reload
INFO: Reloading Context with name [/abcd1234] is completed
I am getting this warning in an java servlet application which is deployed on tomcat. I am creating threads to do scheduled task execution. But I am not destroying/stopping the threads in any part of the code as I don't know what't the best way to handle it in servlets without crashing the whole application or tomcat.
Please help how to prevent memory leaks so that I can run the app forever without being forced to restart the app all the time
thanks
-anshu
Nov 16, 2015 4:52:20 PM org.apache.catalina.core.S
INFO: Reloading Context with name [/abcd1234] has started
Nov 16, 2015 4:52:20 PM org.apache.catalina.loader
SEVERE: The web application [/abcd1234] appears to have started a thread named [pool-1-thread-1] but has failed to stop it. This is very likely to create a memory leak.
Nov 16, 2015 4:52:22 PM org.apache.catalina.startu
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Nov 16, 2015 4:52:22 PM org.apache.catalina.core.S
INFO: Reloading Context with name [/abcd1234] is completed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This is in reference to the following questionAre you sure it's not more apt to quote THIS one?
https://www.experts-exchange.com/questions/28808959/How-to-create-java-threads-with-multiple-start-and-run-signatures.html
ASKER
thank you experts
You're welcome!
ASKER
https://www.experts-exchange.com/questions/28808959/How-to-create-java-threads-with-multiple-start-and-run-signatures.html