2014-11-01 175 views
2

如何增加Tomcat HeapSize(JVM堆)? 獲取下面的錯誤服務器控制檯如何增加Eclipse IDE中的堆大小以運行JavaWebApplication?

INFO: Destroying ProtocolHandler ["ajp-bio-8009"] 
Nov 01, 2014 8:41:34 PM org.apache.catalina.core.ContainerBase removeChild 
SEVERE: ContainerBase.removeChild: destroy: 
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted    ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] in state [STARTING_PREP] 
at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:409) 
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:299) 
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1041) 
at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1234) 
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305) 
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1041) 
at org.apache.catalina.core.ContainerBase.destroyInternal(ContainerBase.java:1234) 
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305) 
at org.apache.catalina.core.StandardService.destroyInternal(StandardService.java:593) 
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305) 
at org.apache.catalina.core.StandardServer.destroyInternal(StandardServer.java:822) 
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:305) 
at org.apache.catalina.startup.Catalina.start(Catalina.java:695) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.lang.reflect.Method.invoke(Unknown Source) 
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322) 
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456) 

將任何一個可以幫助我解決這個問題呢?

回答

2

您可以通過多種方式來實現。 從eclipse中你可以在啓動配置參數中設置。全部在這個link被描述。

另一種方式是設置CATALINA_OPTS一樣在你的catalina.sh文件:

export CATALINA_OPTS="-Xms512M -Xmx1024M" 

另一種方式是設置JAVA_OPTS這樣的:

export JAVA_OPTS="-server -Xmx512m"(但它不是由tomcat的recomended)。

嘗試這些選項,並採取什麼解決您的問題。

我希望有幫助。