【发布时间】:2017-01-03 03:20:19
【问题描述】:
我使用 Quartz 每小时运行一次作业。 servlet 在 Tomcat 上运行,我使用 ServletConextListener 来监听上下文何时被销毁。
当我关闭 tomcat 时,我收到消息:
“似乎已经启动了一个名为 [MyScheduler_Worker-1] 的线程,但未能停止它”。
但后来我看到这条消息:
“[DEBUG] 9 月 28 日上午 11:45:26.671 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.
【问题讨论】:
-
据说Tomcat没有给Quartz足够的时间来关闭线程。但我还无法验证这一点。
标签: tomcat memory-leaks quartz-scheduler