quartz集群报错but has failed to stop it. This is very likely to create a memory leak.
2016-09-22 15:10
309 查看
quartz集群报错but has failed to stop it. This is very likely to create a memory leak.
在一台配置1核2G内存的阿里云服务器上运行quartz;执行定时任务报如下异常,而在本地开发环境中则正常运行。
根据异常,初步判断是内存溢出导致的问题。查看服务器内存使用情况
于是查看
pool-size="10",queue-capacity="20"。
然而根据实际情况并,连接池数量和容量并不需要这么大。改成
查看服务器内存使用情况
在一台配置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
相关文章推荐
- Container With Most Water水箱问题
- connect_timeout interactive_timeout net_read_timeout net_write_timeout wait_timeout
- leetcode 70. Climbing Stairs
- 503 Service Temporarily Unavailable
- LightOj1366 - Pair of Touching Circles(求矩形内圆的对数)
- 基于N源码的Activity的启动过程分析
- 视线追逐
- SUBMAIL云通讯平台——如何避免邮件进入垃圾箱的方法
- hdu 5759 2016 Multi-University Training Contest 3 Gardener Bo 解题报告
- 使用AIDL实现进程间的通信之复杂类型传递
- 基于机器学习方法的POI品类推荐算法
- 219. Contains Duplicate II 超时
- 条件变量pthread_cond_wait(&g_cond,&mutex);
- sigwait 函数的使用
- 深入理解主函数main()的输入参数及返回值问题
- Gitlab RPC failed; result=22, HTTP code = 413 解决方法
- man pthread_mutex_lock,man pthread_cond_wait没文档的解决办法
- Contains Duplicate
- Could not find a storyboard named 'Main' in bundle NSBundle
- NEFU OJ33 Fair Number