1

permgen に関連するメモリ不足エラーが発生しています。

INFO: Deploying web application archive /usr/local/apache-tomcat-7.0.50/webapps/web.war
Jul 09, 2014 2:26:35 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart

Jul 09, 2014 2:26:35 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/web] startup failed due to previous errors
Jul 09, 2014 2:26:36 PM org.apache.catalina.startup.HostConfig deployWARs
SEVERE: Error waiting for multi-thread deployment of WAR files to complete
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:812)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:489)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1592)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:331)
    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:402)
    at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1140)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:801)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.OutOfMemoryError: PermGen space
    at java.util.concurrent.ConcurrentHashMap$Values.iterator(ConcurrentHashMap.java:1449)
    at java.util.AbstractCollection.toArray(AbstractCollection.java:179)
    at org.apache.catalina.session.ManagerBase.findSessions(ManagerBase.java:707)
    at org.apache.catalina.session.StandardManager.stopInternal(StandardManager.java:525)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5643)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:634)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1074)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1858)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    ... 4 more

Jul 09, 2014 2:26:36 PM org.apache.catalina.core.ContainerBase startInternal
SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:188)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1123)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:690)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)
Caused by: java.lang.OutOfMemoryError: PermGen space
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:1130)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:491)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1592)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:331)
    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:402)
    at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:347)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1140)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:801)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

Exception in thread "main"
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"

これは setenv.sh の JAVA_OPTS 変数です。

export JAVA_OPTS="-Xms1g -Xmx2g -XX:MaxPermSize=2g"

intellij から (同じオプションを使用して) tomcat を実行すると、問題なく動作し、web war がデプロイされます。ランニング

コマンドラインから catalina.sh jpda start を実行すると、そのエラーが発生します。

JRE_HOME の使用: /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home

`

私は最近jdk1.8を持っていたので、このリンクからの回答を使用して削除しました。

Mac から Java 8 を削除する

$ java -version
java version "1.7.0_60" Java(TM) SE Runtime Environment (ビルド 1.7.0_60-b19) Java HotSpot(TM) 64 ビット サーバー VM (ビルド 24.60-b09、混合モード)

» echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/jre

どんな助けでも感謝します、ありがとう。

4

1 に答える 1