1

My Jenkins does not want to start with parameters -Xrs -Xmx2048m -XX:MaxPermSize=512m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 in jenkins.xml file. I also added JENKINS_HOME variable to windows variables and set path to my jenkins folder c:\Program Files (x86)\Jenkins. But it does not help. I see in the log file error

Error: Could not create the Java Virtual Machine. 
Error: A fatal exception has occurred. Program will exit. 

Can somebody help me?

  • Why do you expect it to be able to start? – Thorbjørn Ravn Andersen Feb 26 '15 at 14:05
  • Also I've added option in Global properties in Jenkins MAVEN_OPTS -Xmx1024m -XX:MaxPermSize=512m –  Feb 26 '15 at 14:07
  • I looked at this solution http://stackoverflow.com/questions/5936519/how-to-give-jenkins-more-heap-space-when-it%C2%B4s-started-as-a-service-under-windows/28740885#28740885 –  Feb 26 '15 at 14:08
  • I want to size up JVM because of error in Jenkins [code]java.lang.OutOfMemoryError: PermGen space[code] when I run my soap ui tests –  Feb 26 '15 at 14:13
  • You are looking in the wrong place. When you run your tests inside jenkins a new process is spawned and your idea with setting `MAVEN_OPTS` inside jenkins is a good one. A way forward may be to run the test succesfully outside jenkins and then *copy* the setup to the jenkins build. – froderik Feb 26 '15 at 14:21
  • You should not set any options on the Jenkins invocation. Instead adjust the job running your soap ui tests. – Thorbjørn Ravn Andersen Feb 26 '15 at 14:22
  • I need a report after running of tests. And I use free version of Soap UI. I use build file for running my created soap ui tests in jenkins. And now I have more tests and get error `java.lang.OutOfMemoryError: PermGen space` –  Feb 27 '15 at 07:11

2 Answers2

2

Most likely you are using 32-bit JVM on Windows. This has a heap limit of about 1.2 - 1.5 GB depending on what you have run before.

I suggest either limiting yourself to -Xmx1200m or use a 64-bit JVM.

If you increase the PermGen, you need to decrease the heap size as the amount of virtual memory you can have in 32-bit windows is limited.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • I looked at `java -version` and it showed me that I use 64bit version: `java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b18) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)` –  Feb 27 '15 at 07:02
  • How can I increase size of JVM? –  Feb 27 '15 at 07:07
  • @takeshi85 and you are sure this is the version Jenkins is using, not one installed under the Jenkins directory? – Peter Lawrey Feb 27 '15 at 07:07
  • I use the last version of jenkins `jenkins-1.599` Only one version I have –  Feb 27 '15 at 07:26
  • Should I install slave mod for Jenkins? –  Feb 27 '15 at 07:30
  • @takeshi85 many applications ship with their own version of java. Can you look in the program files to see if Jenkins does this? – Peter Lawrey Feb 27 '15 at 07:41
  • Yes, it does. But I set option `JDK installations` for Jenkins to my own installed java –  Feb 27 '15 at 12:10
  • @takeshi85 what did you set the JVM for Jenkins to be. This setting only changes which JDK to perform the individual builds under. – Peter Lawrey Feb 27 '15 at 15:14
  • Ok, I set path to my java 1.8 and in project I can specify Java Option. Now I'm trying to build my project with this http://prntscr.com/6ajesl option –  Feb 27 '15 at 17:09
2

I found solution. Need to update JRE version of Jenkins in its folder. I just copied new files to its folder and replaced the same files) Now I can start Jenkins with option

<arguments>-Xrs -Xmx2048m -  Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar   "%BASE%\jenkins.war" --httpPort=8080</arguments>

Also I use soap ui api for running tests in Jenkins. I changed option

set JAVA_OPTS=-Xms512m -Xmx2048m -Dsoapui.properties=soapui.properties "-Dsoapui.home=%SOAPUI_HOME%\"

in testrunner.bat And now my tests are run correctly and there are no errors Perm Gen!