Reputation: 62736
This could be a duplicate of Installing Sonar and Jenkins on Tomcat, if the replies to that question helped me.
Alas, I have set CATALINA_OPTS
to -Dfile.encoding=UTF-8 -server -Xmx2560m -XX:MaxPermSize=1024m
, which is way above what is recommended in the aforementioned post and I still get OutOfMemoryException: PermGen space messages.
I must add that I got to these values after having jumped in 256m steps from -Xmx1536m
and -XX:MaxPermSize=256m
.
I am sure the tomcat7 process sees this environment setting - ProcessExplorer confirms it is visible to it.
I am running tomcat 7 with Java 6 as a windows service on Win2008R2 64 bits with 8GB of RAM. Tomcat is the only heavy process running - RAM is available.
The problem is surely with Sonar (I have downloaded 2.12), since this issue has appeared immediately after I have deployed Sonar to Tomcat.
What can I do to troubleshoot this issue? It drives me mad.
Thanks.
EDIT
Here is the latest 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)
Here is the latest catalina.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
Neither commons-daemon.2011-12-21.log nor localhost.2011-12-21.log contain any errors.
Here is the respective 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
Upvotes: 0
Views: 3012
Reputation: 62736
The answer is given by prunge in How to pass a system property to a web application hosted in Tomcat 7 running as a Windows Service? - For an unknown reason, tomcat Windows Service expects JVM arguments to be found in the Registry.
Upvotes: 0
Reputation: 8169
Try adding this to Tomcat command line:
-XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
Upvotes: 1