Reputation: 21
Good morning, i am trying to syncronize my Eclipse project with the Sonar server we have in our Company. I tried with 2 completely different computers/environments but cannot find a solution, even if I tried to apply every suggested tip found here (stackOverflow) or elsewhere.
It seems (as clearly explained by the stacktrace) that I may have a memory lack and, since the project is really huge, it may be obvious, but pheraps I cannot (or I don't know) how to launch eclipse with more memory. I modified the eclipse.ini as below:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
1024m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms512m
-Xmx2048m
-XX:MaxPermSize=2048m
but nothing.
Later modified the Windows / Preferences / SonarQube / JVM arguments for analysis with:
-Xmx2048m
Tried later Windows / Preferences / SonarQube / Preview Analysis Properties with:
wrapper.java.maxmemory = 6000
but nothing. Eclipse cannot finish analysis (maybe just cannot store data in local db).
These are the environment specs (of the best machine...):
Windows 8 64bit - 8GB RAM
java version "1.7.0" Java(TM) SE Runtime Environment (build 1.7.0-b147) Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
Eclipse Standard/SDK Version: Luna Release (4.4.0) Build id: 20140612-0600
Retrieve remote issues of project PREPRODUZIONE...
Start SonarQube analysis on PREPRODUZIONE...
INFO: SonarQube Server 4.3
11:09:32.970 INFO - Incremental mode
11:09:32.972 INFO - Load batch settings
11:09:33.196 INFO - User cache: C:\Users\alex\.sonar\cache
11:09:33.201 INFO - Install plugins
11:09:33.235 INFO - Include plugins:
11:09:33.235 INFO - Exclude plugins: devcockpit, jira, pdfreport, views, report, buildstability, scmactivity, buildbreaker
11:09:41.588 INFO - Create JDBC datasource for jdbc:h2:C:\ECLIPSE\3.3.2\.metadata\.plugins\org.eclipse.core.resources\.projects\PREPRODUZIONE\org.sonar.ide.eclipse.core\.sonartmp\preview1406279373883-0
11:09:42.716 INFO - Initializing Hibernate
11:09:45.471 INFO - Load project settings
11:09:45.553 INFO - Apply project exclusions
11:09:45.653 INFO - ------------- Scan PREPRODUZIONE
11:09:45.657 INFO - Load module settings
11:09:46.788 INFO - Loading technical debt model...
11:09:46.794 INFO - Loading technical debt model done: 6 ms
11:09:46.794 INFO - Loading rules...
11:09:47.056 INFO - Loading rules done: 262 ms
11:09:47.065 INFO - Configure Maven plugins
11:09:47.127 INFO - Compare to previous analysis (2014-07-10)
11:09:47.133 INFO - Compare over 30 days (2014-06-25, analysis of 2014-07-10 00:13:19.304)
11:09:47.140 INFO - Compare to previous version (2014-07-10)
11:09:47.425 INFO - Loaded quality gate 'RGI Standard - java '
11:09:47.824 INFO - Base dir: C:\ECLIPSE\3.3.2\PREPRODUZIONE
11:09:47.824 INFO - Working dir: C:\ECLIPSE\3.3.2\.metadata\.plugins\org.eclipse.core.resources\.projects\PREPRODUZIONE\org.sonar.ide.eclipse.core
11:09:47.824 INFO - Source dirs: C:\ECLIPSE\3.3.2\PREPRODUZIONE\src\java
11:09:47.824 INFO - Binary dirs: C:\ECLIPSE\3.3.2\PREPRODUZIONE\bin
11:09:47.824 INFO - Source encoding: windows-1252, default locale: it_IT
11:09:47.825 INFO - Index files
11:09:48.879 INFO - 1095 files indexed
11:09:53.579 INFO - Quality profile for java: RGI Standard
11:09:53.579 INFO - Quality profile for xml: Sonar way
11:09:53.898 INFO - JaCoCo report not found.
11:09:53.899 INFO - JaCoCo IT report not found.
11:09:53.899 INFO - JaCoCo reports not found.
11:09:53.915 INFO - Sensor JavaSquidSensor...
11:09:54.088 INFO - Java Main Files AST scan...
11:09:54.091 INFO - 1091 source files to be analyzed
11:10:04.092 INFO - 226/1091 files analyzed, current is C:\ECLIPSE\3.3.2\PREPRODUZIONE\src\java\it\boh\dbo\Vehicle.java
11:10:13.450 INFO - 1091/1091 source files analyzed
11:10:13.587 INFO - Java Main Files AST scan done: 19499 ms
11:10:13.624 INFO - Java bytecode scan...
11:10:14.759 INFO - Java bytecode scan done: 1135 ms
11:10:14.759 INFO - Java Test Files AST scan...
11:10:14.759 INFO - 0 source files to be analyzed
11:10:14.759 INFO - Java Test Files AST scan done: 0 ms
11:10:14.760 INFO - 0/0 source files analyzed
11:10:16.066 INFO - Sensor JavaSquidSensor done: 22151 ms
11:10:16.066 INFO - Sensor QProfileSensor...
11:10:16.067 INFO - Sensor QProfileSensor done: 1 ms
11:10:16.067 INFO - Sensor FindbugsSensor...
11:10:16.068 INFO - Execute Findbugs 2.0.3...
11:10:17.667 INFO - Found findbugs plugin: /C:/Users/alex/.sonar/cache/108e4763f8b1f4a0e9de5d1fa2aba85b/sonar-fb-contrib-plugin-1.2.jar_unzip/META-INF/lib/fb-contrib-4.8.5.jar
11:10:17.827 INFO - Findbugs output report: C:\ECLIPSE\3.3.2\.metadata\.plugins\org.eclipse.core.resources\.projects\PREPRODUZIONE\org.sonar.ide.eclipse.core\findbugs-result.xml
Frame type field is null:false
11:11:20.205 INFO - Execute Findbugs 2.0.3 done: 64137 ms
11:11:20.287 INFO - Sensor FindbugsSensor done: 64220 ms
11:11:20.287 INFO - Sensor CpdSensor...
11:11:20.288 INFO - SonarEngine is used for java
11:11:20.294 INFO - Cross-project analysis disabled
11:11:23.923 INFO - Sensor CpdSensor done: 3636 ms
11:11:23.923 INFO - Sensor PmdSensor...
11:11:23.924 INFO - Execute PMD 5.1.1...
11:11:24.017 INFO - Java version: 1.5
11:11:24.095 INFO - PMD configuration: C:\ECLIPSE\3.3.2\.metadata\.plugins\org.eclipse.core.resources\.projects\PREPRODUZIONE\org.sonar.ide.eclipse.core\pmd.xml
11:11:38.763 INFO - Execute PMD 5.1.1 done: 14839 ms
11:11:38.871 INFO - Sensor PmdSensor done: 14948 ms
11:11:38.871 INFO - Sensor XmlSensor...
11:11:39.069 INFO - Sensor XmlSensor done: 198 ms
11:11:39.070 INFO - Sensor LineCountSensor...
11:11:39.085 INFO - Sensor LineCountSensor done: 15 ms
11:11:39.086 INFO - Sensor SurefireSensor...
11:11:39.087 INFO - parsing C:\ECLIPSE\3.3.2\.metadata\.plugins\org.eclipse.core.resources\.projects\PREPRODUZIONE\org.sonar.ide.eclipse.core\build\surefire-reports
11:11:39.087 WARN - Reports path not found: C:\ECLIPSE\3.3.2\.metadata\.plugins\org.eclipse.core.resources\.projects\PREPRODUZIONE\org.sonar.ide.eclipse.core\build\surefire-reports
11:11:39.087 INFO - Sensor SurefireSensor done: 1 ms
11:11:39.087 INFO - Sensor CheckstyleSensor...
11:11:39.088 INFO - Execute Checkstyle 5.6...
11:11:39.161 INFO - Checkstyle configuration: C:\ECLIPSE\3.3.2\.metadata\.plugins\org.eclipse.core.resources\.projects\PREPRODUZIONE\org.sonar.ide.eclipse.core\checkstyle.xml
11:11:54.484 INFO - Execute Checkstyle 5.6 done: 15396 ms
11:11:54.484 INFO - Sensor CheckstyleSensor done: 15397 ms
11:11:54.484 INFO - Sensor InitialOpenIssuesSensor...
11:11:54.733 INFO - Sensor InitialOpenIssuesSensor done: 249 ms
11:11:54.734 INFO - Sensor ProfileEventsSensor...
11:11:54.745 INFO - Sensor ProfileEventsSensor done: 11 ms
11:11:54.745 INFO - Sensor ProjectLinksSensor...
11:11:54.751 INFO - Sensor ProjectLinksSensor done: 6 ms
11:11:55.040 INFO - Execute decorators...
11:13:35.682 INFO - Export results to C:\ECLIPSE\3.3.2\.metadata\.plugins\org.eclipse.core.resources\.projects\PREPRODUZIONE\org.sonar.ide.eclipse.core\sonar-report.json
11:13:36.629 INFO - Store results in database
Exception in thread "main" org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.impl.BatchLauncherMain.execute(BatchLauncherMain.java:41)
at org.sonar.runner.impl.BatchLauncherMain.main(BatchLauncherMain.java:59)
Caused by: java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at org.sonar.runner.impl.IsolatedClassloader.loadClass(IsolatedClassloader.java:94)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.hql.ast.SqlASTFactory.class$(SqlASTFactory.java:101)
at org.hibernate.hql.ast.SqlASTFactory.getASTNodeType(SqlASTFactory.java:103)
at antlr.ASTFactory.create(ASTFactory.java:152)
at antlr.ASTFactory.create(ASTFactory.java:186)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.updateStatement(HqlSqlBaseWalker.java:327)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:239)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1651)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:93)
at org.sonar.jpa.session.JpaDatabaseSession.createQuery(JpaDatabaseSession.java:184)
at org.sonar.batch.phases.UpdateStatusJob.setFlags(UpdateStatusJob.java:133)
at org.sonar.batch.phases.UpdateStatusJob.disablePreviousSnapshot(UpdateStatusJob.java:95)
Any other suggestions?
Thanks Alessandro
Upvotes: 1
Views: 2842
Reputation: 1406
Try going to Window / Preferences / SonarQube and enter your maxPermSize value in the "JVM arguments for preview analysis" box:
Upvotes: 2
Reputation: 1
Set the below environment variable and the try to run the sonar runner Variable Name: SONAR_RUNNER_OPTS Variable Value: -Xmx512m -XX:MaxPermSize=128m
Upvotes: -1