通过shell脚本和命令行重启tomcat之间的区别

时间:2017-02-27 03:03:45

标签: linux bash shell tomcat

我想重启Tomcat

我制作了一个shell脚本(名称为a.sh)

a.sh内容

/bin/sh /tomcatdirectroy/bin/shutdown.sh
/bin/sleep 120
/bin/sh /tomcatdirectroy/bin/startup.sh

当我执行a.sh(/ bin / sh a.sh)时,我收到Tomcat内存泄漏错误....

当我从命令行启动脚本时,不会发生此错误:

/bin/sh /tomcatdirectroy/bin/shutdown.sh
/bin/sleep 120
/bin/sh /tomcatdirectroy/bin/startup.sh

现在Tomcat正常运行而没有内存泄漏。

为什么..?

使用启动和停止脚本调用有什么区别 另一个shell脚本从命令行调用它们?

a.sh excute(catalina.out目录)

java.lang.Thread.run(Thread.java:745)
26-Feb-2017 00:39:49.832 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [wiki] appears to have started a thread named [AtlassianEvent::CustomizableThreadFactory-5] 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.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 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)
26-Feb-2017 00:39:49.832 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [wiki] appears to have started a thread named [AtlassianEvent::CustomizableThreadFactory-6] 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.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 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)
26-Feb-2017 00:39:49.833 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [wiki] appears to have started a thread named [AtlassianEvent::CustomizableThreadFactory-7] 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.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 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)
26-Feb-2017 00:39:49.833 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [wiki] appears to have started a thread named [AtlassianEvent::CustomizableThreadFactory-8] 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.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 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)
26-Feb-2017 00:39:49.833 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [wiki] appears to have started a thread named [AtlassianEvent::CustomizableThreadFactory-9] 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.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 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)
26-Feb-2017 00:39:49.834 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [wiki] appears to have started a thread named [AtlassianEvent::CustomizableThreadFactory-10] 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.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 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)
26-Feb-2017 00:39:49.834 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [wiki] appears to have started a thread named [AtlassianEvent::CustomizableThreadFactory-11] 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.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 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)
26-Feb-2017 00:39:49.835 WARNING [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [wiki] appears to have started a thread named [AtlassianEvent::CustomizableThreadFactory-12] 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.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 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)
26-Feb-2017 00:39:49.835 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [com.atlassian.confluence.concurrent.ThreadLocalMap] (value [com.atlassian.confluence.concurrent.ThreadLocalMap@778ef6c9]) and a value of type [java.util.HashMap] (value [{}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.836 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [com.opensymphony.xwork.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork.ActionContext$ActionContextThreadLocal@4dac55b5]) and a value of type [com.opensymphony.xwork.ActionContext] (value [com.opensymphony.xwork.ActionContext@3e57e58d]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.836 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [com.opensymphony.xwork.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork.ActionContext$ActionContextThreadLocal@4dac55b5]) and a value of type [com.opensymphony.xwork.ActionContext] (value [com.opensymphony.xwork.ActionContext@11a17319]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.836 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [com.opensymphony.xwork.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork.ActionContext$ActionContextThreadLocal@4dac55b5]) and a value of type [com.opensymphony.xwork.ActionContext] (value [com.opensymphony.xwork.ActionContext@f2747fb]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.837 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [com.opensymphony.xwork.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork.ActionContext$ActionContextThreadLocal@4dac55b5]) and a value of type [com.opensymphony.xwork.ActionContext] (value [com.opensymphony.xwork.ActionContext@45a124cf]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.837 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [com.opensymphony.xwork.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork.ActionContext$ActionContextThreadLocal@4dac55b5]) and a value of type [com.opensymphony.xwork.ActionContext] (value [com.opensymphony.xwork.ActionContext@44dbca7b]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.837 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [com.opensymphony.xwork.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork.ActionContext$ActionContextThreadLocal@4dac55b5]) and a value of type [com.opensymphony.xwork.ActionContext] (value [com.opensymphony.xwork.ActionContext@5e785042]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.837 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [com.opensymphony.xwork.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork.ActionContext$ActionContextThreadLocal@4dac55b5]) and a value of type [com.opensymphony.xwork.ActionContext] (value [com.opensymphony.xwork.ActionContext@6bd5dce9]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.837 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [com.opensymphony.xwork.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork.ActionContext$ActionContextThreadLocal@4dac55b5]) and a value of type [com.opensymphony.xwork.ActionContext] (value [com.opensymphony.xwork.ActionContext@279e1a00]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.838 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [org.apache.http.client.utils.DateUtils$DateFormatHolder$1] (value [org.apache.http.client.utils.DateUtils$DateFormatHolder$1@396e5a12]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@3d0c849a]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.839 SEVERE [localhost-startStop-2] org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [wiki] created a ThreadLocal with key of type [net.fortuna.ical4j.model.DateTime$1] (value [net.fortuna.ical4j.model.DateTime$1@216a3939]) and a value of type [java.text.SimpleDateFormat] (value [java.text.SimpleDateFormat@6f64295a]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
26-Feb-2017 00:39:49.845 INFO [Thread-53] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-10000"]
26-Feb-2017 00:39:49.943 INFO [Thread-53] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-10000"]

0 个答案:

没有答案