Как сделать так, чтобы tomcat размещал jenkins и sonar без сбоев с OutOfMemoryException? - PullRequest
0 голосов
/ 21 декабря 2011

Это может быть копия Установка Sonar и Jenkins на Tomcat , если мне помогли ответы на этот вопрос.

Увы, я установил CATALINA_OPTS на -Dfile.encoding=UTF-8 -server -Xmx2560m -XX:MaxPermSize=1024m, что намного выше, чем рекомендуется в вышеупомянутом посте, и я все еще получаю OutOfMemoryException: пространство PermGen сообщений.

Я должен добавить, что я получил эти значения после того, как прыгнул с шагом 256 м от -Xmx1536m и -XX:MaxPermSize=256m.

Я уверен, что процесс tomcat7 видит этот параметр среды - ProcessExplorer подтверждает, что он виден ему.

Я использую Tomcat 7 с Java 6 в качестве службы Windows на 64-битной Win2008R2 с 8 ГБ ОЗУ. Tomcat - единственный тяжелый процесс, работающий с оперативной памятью.

Проблема, безусловно, связана с Sonar (я скачал 2.12), поскольку эта проблема появилась сразу после развертывания Sonar на Tomcat.

Что я могу сделать, чтобы устранить эту проблему? Это сводит меня с ума.

Спасибо.

EDIT

Вот последний tomcat7-stderr.2011-12-21.log:

2011-12-21 14:27:02 Commons Daemon procrun stderr initialized
21/12/2011 14:27:03 org.apache.catalina.core.AprLifecycleListener init
INFO: An older version 1.1.20 of the APR based Apache Tomcat Native library is installed, while Tomcat recommends a minimum version of 1.1.22
21/12/2011 14:27:03 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
21/12/2011 14:27:03 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
21/12/2011 14:27:03 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
21/12/2011 14:27:03 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
21/12/2011 14:27:03 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 720 ms
21/12/2011 14:27:03 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
21/12/2011 14:27:03 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.20
21/12/2011 14:27:03 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive jenkins.war
21/12/2011 14:27:04 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive sonar.war
21/12/2011 14:27:04 jenkins.model.Jenkins$6 onAttained
INFO: Started initialization
21/12/2011 14:27:04 jenkins.model.Jenkins$6 onAttained
INFO: Listed all plugins
21/12/2011 14:27:05 jenkins.model.Jenkins$6 onAttained
INFO: Prepared all plugins
21/12/2011 14:27:05 jenkins.model.Jenkins$6 onAttained
INFO: Started all plugins
21/12/2011 14:27:05 jenkins.model.Jenkins$6 onAttained
INFO: Augmented all extensions
21/12/2011 14:27:07 jenkins.model.Jenkins$6 onAttained
INFO: Loaded all jobs
21/12/2011 14:27:07 jenkins.model.Jenkins$6 onAttained
INFO: Completed initialization
21/12/2011 14:27:07 hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 60830
21/12/2011 14:27:18 hudson.slaves.SlaveComputer tryReconnect
INFO: Attempting to reconnect vm-builder
21/12/2011 14:27:18 hudson.WebAppMain$2 run
INFO: Jenkins is fully up and running
java.lang.OutOfMemoryError: PermGen space
    at java.lang.Throwable.getStackTraceElement(Native Method)
    at java.lang.Throwable.getOurStackTrace(Throwable.java:591)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:529)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTraceAsCause(Throwable.java:545)
    at java.lang.Throwable.printStackTrace(Throwable.java:516)
    at java.util.logging.SimpleFormatter.format(SimpleFormatter.java:72)
    at org.apache.juli.FileHandler.publish(FileHandler.java:200)
    at java.util.logging.Logger.log(Logger.java:481)
    at java.util.logging.Logger.doLog(Logger.java:503)
    at java.util.logging.Logger.logp(Logger.java:703)
    at org.apache.juli.logging.DirectJDKLog.log(DirectJDKLog.java:185)
    at org.apache.juli.logging.DirectJDKLog.error(DirectJDKLog.java:151)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:815)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:932)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:723)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    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:389)
    at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)

Вот последняя каталина.2011-12-21.log:

21/12/2011 14:27:03 org.apache.catalina.core.AprLifecycleListener init
INFO: An older version 1.1.20 of the APR based Apache Tomcat Native library is installed, while Tomcat recommends a minimum version of 1.1.22
21/12/2011 14:27:03 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.20.
21/12/2011 14:27:03 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
21/12/2011 14:27:03 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8080"]
21/12/2011 14:27:03 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
21/12/2011 14:27:03 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 720 ms
21/12/2011 14:27:03 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
21/12/2011 14:27:03 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.20
21/12/2011 14:27:03 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive jenkins.war
21/12/2011 14:27:04 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive sonar.war
21/12/2011 14:27:04 jenkins.model.Jenkins$6 onAttained
INFO: Started initialization
21/12/2011 14:27:04 jenkins.model.Jenkins$6 onAttained
INFO: Listed all plugins
21/12/2011 14:27:05 jenkins.model.Jenkins$6 onAttained
INFO: Prepared all plugins
21/12/2011 14:27:05 jenkins.model.Jenkins$6 onAttained
INFO: Started all plugins
21/12/2011 14:27:05 jenkins.model.Jenkins$6 onAttained
INFO: Augmented all extensions
21/12/2011 14:27:07 jenkins.model.Jenkins$6 onAttained
INFO: Loaded all jobs
21/12/2011 14:27:07 jenkins.model.Jenkins$6 onAttained
INFO: Completed initialization
21/12/2011 14:27:07 hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 60830
21/12/2011 14:27:18 hudson.slaves.SlaveComputer tryReconnect
INFO: Attempting to reconnect vm-builder
21/12/2011 14:27:18 hudson.WebAppMain$2 run
INFO: Jenkins is fully up and running

Ни commons-daemon.2011-12-21.log, ни localhost.2011-12-21.log не содержат ошибок.

Вот соответствующий sonar.log:

2011.12.21 14:27:16 INFO  o.s.p.Database  Create JDBC datasource
2011.12.21 14:27:17 INFO  org.sonar.INFO  Initializing Hibernate
2011.12.21 14:27:18 INFO  org.sonar.INFO  Start services...
2011.12.21 14:27:18 INFO  org.sonar.INFO  Sonar home: C:\sonar-2.12
2011.12.21 14:27:18 INFO  org.sonar.INFO  Deploy dir: C:\Program Files\Apache Software Foundation\Tomcat 7.0\temp\0-sonar\deploy
2011.12.21 14:27:18 INFO  org.sonar.INFO  Install plugins...
2011.12.21 14:27:18 INFO  org.sonar.INFO  Install plugins done: 514 ms
2011.12.21 14:27:19 INFO  org.sonar.INFO  Notification service started (delay 60 sec.)
2011.12.21 14:27:19 INFO  org.sonar.INFO  Deploy GWT plugins...
2011.12.21 14:27:19 INFO  org.sonar.INFO  publish org.sonar.plugins.core.testdetailsviewer.TestsViewer to C:\Program Files\Apache Software Foundation\Tomcat 7.0\temp\0-sonar\deploy\gwt
2011.12.21 14:27:20 INFO  org.sonar.INFO  publish org.sonar.plugins.core.hotspots.GwtHotspots to C:\Program Files\Apache Software Foundation\Tomcat 7.0\temp\0-sonar\deploy\gwt
2011.12.21 14:27:20 INFO  org.sonar.INFO  publish org.sonar.plugins.design.ui.libraries.LibrariesPage to C:\Program Files\Apache Software Foundation\Tomcat 7.0\temp\0-sonar\deploy\gwt
2011.12.21 14:27:20 INFO  org.sonar.INFO  publish org.sonar.plugins.design.ui.page.DesignPage to C:\Program Files\Apache Software Foundation\Tomcat 7.0\temp\0-sonar\deploy\gwt
2011.12.21 14:27:21 INFO  org.sonar.INFO  publish org.sonar.plugins.design.ui.dependencies.DependenciesTab to C:\Program Files\Apache Software Foundation\Tomcat 7.0\temp\0-sonar\deploy\gwt
2011.12.21 14:27:21 INFO  org.sonar.INFO  publish org.sonar.plugins.design.ui.lcom4.Lcom4Tab to C:\Program Files\Apache Software Foundation\Tomcat 7.0\temp\0-sonar\deploy\gwt
2011.12.21 14:27:21 INFO  org.sonar.INFO  Deploy GWT plugins done: 1794 ms
2011.12.21 14:27:21 INFO  org.sonar.INFO  Load metrics...
2011.12.21 14:27:22 INFO  org.sonar.INFO  cleaning alert thresholds...
2011.12.21 14:27:22 INFO  org.sonar.INFO  Load metrics done: 765 ms
2011.12.21 14:27:22 INFO  org.sonar.INFO  Register rules [findbugs/java]...
2011.12.21 14:27:22 INFO  org.sonar.INFO  384 rules
2011.12.21 14:27:23 INFO  org.sonar.INFO  Register rules [findbugs/java] done: 624 ms
2011.12.21 14:27:23 INFO  org.sonar.INFO  Register rules [checkstyle/java]...
2011.12.21 14:27:23 INFO  org.sonar.INFO  122 rules
2011.12.21 14:27:23 INFO  org.sonar.INFO  Register rules [checkstyle/java] done: 296 ms
2011.12.21 14:27:23 INFO  org.sonar.INFO  Register rules [pmd/java]...
2011.12.21 14:27:23 INFO  org.sonar.INFO  224 rules
2011.12.21 14:27:23 INFO  org.sonar.INFO  Register rules [pmd/java] done: 328 ms
2011.12.21 14:27:23 INFO  org.sonar.INFO  Register rules [squid/java]...
2011.12.21 14:27:23 INFO  org.sonar.INFO  12 rules
2011.12.21 14:27:23 INFO  org.sonar.INFO  Register rules [squid/java] done: 124 ms
2011.12.21 14:27:23 INFO  org.sonar.INFO  Disable deprecated user rules...
2011.12.21 14:27:23 INFO  org.sonar.INFO  Disable deprecated user rules done: 94 ms
2011.12.21 14:27:23 INFO  org.sonar.INFO  Load provided profiles...
2011.12.21 14:27:26 INFO  org.sonar.INFO  Clean provided profiles...
2011.12.21 14:27:27 INFO  org.sonar.INFO  Clean provided profiles done: 575 ms
2011.12.21 14:27:27 INFO  org.sonar.INFO  Save profile [name=Sonar way with Findbugs,language=java]...
2011.12.21 14:27:27 INFO  org.sonar.INFO  Save profile [name=Sonar way with Findbugs,language=java] done: 548 ms
2011.12.21 14:27:27 INFO  org.sonar.INFO  Save profile [name=Sonar way,language=java]...
2011.12.21 14:27:27 INFO  org.sonar.INFO  Save profile [name=Sonar way,language=java] done: 80 ms
2011.12.21 14:27:27 INFO  org.sonar.INFO  Save profile [name=Sun checks,language=java]...
2011.12.21 14:27:27 INFO  org.sonar.INFO  Save profile [name=Sun checks,language=java] done: 120 ms
2011.12.21 14:27:27 INFO  org.sonar.INFO  Save profile [name=Sonar way with Findbugs,language=java]...
2011.12.21 14:27:27 INFO  org.sonar.INFO  Save profile [name=Sonar way with Findbugs,language=java] done: 62 ms
2011.12.21 14:27:27 INFO  org.sonar.INFO  Save profile [name=Sonar way,language=java]...
2011.12.21 14:27:28 INFO  org.sonar.INFO  Save profile [name=Sonar way,language=java] done: 147 ms
2011.12.21 14:27:28 INFO  org.sonar.INFO  Save profile [name=Sonar way with Findbugs,language=java]...
2011.12.21 14:27:28 INFO  org.sonar.INFO  Save profile [name=Sonar way with Findbugs,language=java] done: 69 ms
2011.12.21 14:27:28 INFO  org.sonar.INFO  Save profile [name=Sun checks,language=java]...
2011.12.21 14:27:28 INFO  org.sonar.INFO  Save profile [name=Sun checks,language=java] done: 21 ms
2011.12.21 14:27:28 INFO  org.sonar.INFO  Load provided profiles done: 4332 ms
2011.12.21 14:27:28 INFO  org.sonar.INFO  Enable profiles...
2011.12.21 14:27:28 INFO  org.sonar.INFO  Enable profiles done: 12 ms
2011.12.21 14:27:28 INFO  org.sonar.INFO  Activate default profile for java
2011.12.21 14:27:28 INFO  org.sonar.INFO  Register quality models...
2011.12.21 14:27:28 INFO  org.sonar.INFO  Register quality models done: 0 ms
2011.12.21 14:27:28 INFO  org.sonar.INFO  Start services done: 9958 ms

Ответы [ 2 ]

1 голос
/ 21 декабря 2011

Попробуйте добавить это в командную строку Tomcat:

-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
0 голосов
/ 24 декабря 2011

Ответ дает prunge in Как передать системное свойство веб-приложению, размещенному в Tomcat 7, работающем как служба Windows? - По неизвестной причине tomcat Windows Служба ожидает, что аргументы JVM будут найдены в реестре.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...