sab*_*man 7 tomcat memory-leaks quartz-scheduler
我每小时都在使用Quartz来完成一项工作.servlet在Tomcat上运行,我正在使用ServletConextListener监听上下文被销毁的时间.
当我关闭tomcat时,我收到消息:
"似乎已经启动了一个名为[MyScheduler_Worker-1]但未能阻止它的线程".
但后来我看到这个消息:
"[DEBUG] 28 Sep 11:45:26.671 AM MyScheduler_Worker-1 [org.quartz.simpl.SimpleThreadPool]
WorkerThread被关闭."
因此可以安全地假设因为这个线程没有内存泄漏?
这是我的日志的样子:
{SEVERE: The web application [/*************] appears to have started a thread
named [MyScheduler_Worker-1] but has failed to stop it. This is very likely to c
reate a memory leak.
Sep 28, 2011 11:45:26 AM org.apache.catalina.loader.WebappClassLoader clearRefer
encesThreads
SEVERE: The web application [/*************] appears to have started a thread
named [MyScheduler_Worker-2] but has failed to stop it. This is very likely to c
reate a memory leak.
Sep 28, 2011 11:45:26 AM org.apache.catalina.loader.WebappClassLoader clearRefer
encesThreads
SEVERE: The web application [/*************] appears to have started a thread
named [MyScheduler_Worker-3] but has failed to stop it. This is very likely to c
reate a memory leak.
[DEBUG] 28 Sep 11:45:26.671 AM MyScheduler_Worker-2 [org.quartz.simpl.SimpleThre
adPool]
WorkerThread is shut down.
[DEBUG] 28 Sep 11:45:26.671 AM MyScheduler_Worker-1 [org.quartz.simpl.SimpleThre
adPool]
WorkerThread is shut down.
[DEBUG] 28 Sep 11:45:26.671 AM MyScheduler_Worker-3 [org.quartz.simpl.SimpleThre
adPool]
WorkerThread is shut down.
Run Code Online (Sandbox Code Playgroud)
您可以假设没有内存泄漏,因为您看到线程关闭消息。但是,可以通过在关闭之前清除线程来克服警告。
The shutdown-hook plugin catches the event of the JVM terminating, and calls shutdown on the scheduler.
Run Code Online (Sandbox Code Playgroud)
详细信息:- http://quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigPlugins
| 归档时间: |
|
| 查看次数: |
6199 次 |
| 最近记录: |