tomcat内存溢出的解决方法(java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError:)

 

报错信息如下:

严重: Error waiting for multi-thread deployment of directories to completehostConfig.deployWar=Deploying web application archive {0}

java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen spaceat java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)at java.util.concurrent.FutureTask.get(FutureTask.java:83)at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1018)at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:473)at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1412)at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:312)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:346)at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1117)at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:782)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)at java.util.concurrent.FutureTask.run(FutureTask.java:138)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)at java.lang.Thread.run(Thread.java:619)Caused by: java.lang.OutOfMemoryError: PermGen spaceat java.lang.ClassLoader.defineClass1(Native Method)at java.lang.ClassLoader.defineClass(ClassLoader.java:621)at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2823)at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1160)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1655)at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1988)at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1951)at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1840)at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1808)at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1794)at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1214)at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:828)at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:302)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5148)at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

... 5 more

 

 

 

在网上查自资料才知道原来是我的项目中引入了大量的第三方架包所导致的。

最简单的解决办法:

  eclipse中,window-->preferences-->Java-->Installed JREs

  选中JRE 点击Edit

写入这句话:

-Xms800m -Xmx800m -XX:MaxNewSize=256m -XX:MaxPermSize=256m

 

posted @ 2012-08-24 11:26  欢歌911  阅读(6442)  评论(0编辑  收藏  举报