quartz集群报错but has failed to stop it. This is very likely to create a memory leak.

简介:
在一台配置1核2G内存的阿里云服务器上运行quartz;执行定时任务报如下异常,而在本地开发环境中则正常运行。


10-Sep-2016 11:43:50.415 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [faxian] appears to have started a thread named [logback-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
 java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 java.lang.Thread.run(Thread.java:745)
10-Sep-2016 11:43:50.415 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [faxian] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
10-Sep-2016 11:43:50.416 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [faxian] appears to have started a thread named [clusterQuartzScheduler_Worker-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
10-Sep-2016 11:43:50.417 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [faxian] appears to have started a thread named [clusterQuartzScheduler_Worker-2] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
根据异常,初步判断是内存溢出导致的问题。查看服务器内存使用情况


 [root@test-server logs]#  free -h
              total       used       free     shared    buffers     cached
 Mem:          1.8G       1.7G       84M       9.4M       154M       520M
 -/+ buffers/cache:       1.1G       759M
 Swap:           0B         0B         0B
 
于是查看quartz的配置


<task:executor id="quartzTaskExecutor" keep-alive="900" pool-size="10" queue-capacity="20" />
pool-size="10",queue-capacity="20"。

然而根据实际情况并,连接池数量和容量并不需要这么大。改成pool-size="1",queue-capacity="1",再次启动不再报错。

查看服务器内存使用情况


[root@test-server logs]#  free -h
             total       used       free     shared    buffers     cached
Mem:          1.8G       1.7G       141M       9.3M       154M       422M
-/+ buffers/cache:       1.1G       718M
Swap:           0B         0B         0B







本文转自秋楓博客园博客,原文链接:http://www.cnblogs.com/rwxwsblog/p/5896449.html,如需转载请自行联系原作者
目录
相关文章
|
机器学习/深度学习 Kubernetes 关系型数据库
gitlab--job 作业运行控制 tag、when、allow_failure、retry、timeout、parallel
gitlab--job 作业运行控制 tag、when、allow_failure、retry、timeout、parallel
|
Java 索引
logstash问题记录:Attempted to resurrect connection to dead ES instance, but got an error
logstash问题记录:Attempted to resurrect connection to dead ES instance, but got an error
819 0
logstash问题记录:Attempted to resurrect connection to dead ES instance, but got an error
|
网络协议
Job for named.service failed because the control process exited with error code.怎么解决
本篇内容记录了如何解决Job for named.service failed because the control process exited with error code.的问题。
3507 0
Job for named.service failed because the control process exited with error code.怎么解决
|
消息中间件 Java Kafka
Kafka Windows运行错误: Native memory allocation (mmap) failed to map 1073741824 bytes for Failed to comm
Kafka Windows运行错误: Native memory allocation (mmap) failed to map 1073741824 bytes for Failed to comm
678 0
|
Oracle 关系型数据库 Linux
oom_kill_process造成数据库挂起并出现found dead shared server
这篇博客是上一篇博客Oracle shutdown immediate遭遇ORA-24324 ORA-24323 ORA-01089的延伸(数据库挂起hang时,才去重启的),其实这是我们海外一工厂的遇到的案例,把内容拆开是因为这个case分开讲述显得主题明确一些。
1298 0
|
SQL 索引 存储
Troubleshooting SQL Server RESOURCE_SEMAPHORE Waittype Memory Issues
原文:Troubleshooting SQL Server RESOURCE_SEMAPHORE Waittype Memory Issues    前言: 本文是对博客https://www.mssqltips.com/sqlservertip/2827/troubleshooting-sql-server-resourcesemaphore-waittype-memory-issues/的翻译,本文基本直译,部分地方读起来有点不自然。
1107 0