Jenkins som windows service kaster outofmemory

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg har installeret jenkins som windows service og skaber job, der ville påberåbe ant scripts.
Ant scripts består af mxmlc compiler, der ville kompilere flex applikationer. Mens kompilering det mislykkedes og kaster en ekstraordinær undtagelse. Jeg justerede ant\_opts for hukommelse allokering, men til ingen nytte. Men når jeg forsøger at køre jenkins i stand-alone mode, bliver problemet ikke vundet.


Enhver havde lignende problemer jeg har oplevet?


Exceptions:
[javac] Compiling 163 source files to ....
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
 [copy] Copying 21 files to ....
[mxmlc] Loading configuration file ...
[mxmlc] ...
[mxmlc] Loading configuration file ...
[mxmlc] ...
[mxmlc] Loading configuration file ...
[mxmlc] ...
[mxmlc] Loading configuration file ...
[mxmlc] ...
[mxmlc] Loading configuration file C:Program FilesAdobeFlex Builder 3 Plug-insdks3.5.0frameworksflex-config.xml
[mxmlc] Error: PermGen space
[mxmlc] 
[mxmlc] java.lang.OutOfMemoryError: PermGen space
[mxmlc]     at java.lang.ClassLoader.defineClass1(Native Method)
[mxmlc]     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
[mxmlc]     at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
[mxmlc]     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
[mxmlc]     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
[mxmlc]     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
[mxmlc]     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
[mxmlc]     at java.security.AccessController.doPrivileged(Native Method)
[mxmlc]     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
[mxmlc]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[mxmlc]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
[mxmlc]     at org.apache.xerces.parsers.DTDConfiguration.createEntityManager(Unknown Source)
[mxmlc]     at org.apache.xerces.parsers.DTDConfiguration.<init>(Unknown Source)
[mxmlc]     at org.apache.xerces.parsers.StandardParserConfiguration.<init>(Unknown Source)
[mxmlc]     at org.apache.xerces.parsers.IntegratedParserConfiguration.<init>(Unknown Source)
[mxmlc]     at org.apache.xerces.parsers.XML11Configuration.<init>(Unknown Source)
[mxmlc]     at org.apache.xerces.parsers.XML11Configuration.<init>(Unknown Source)
[mxmlc]     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[mxmlc]     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
[mxmlc]     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
[mxmlc]     at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
[mxmlc]     at java.lang.Class.newInstance0(Class.java:355)
[mxmlc]     at java.lang.Class.newInstance(Class.java:308)
[mxmlc]     at org.apache.xerces.util.ObjectFactory.newInstance(Unknown Source)
[mxmlc]     at org.apache.xerces.util.ObjectFactory.findJarServiceProvider(Unknown Source)
[mxmlc]     at org.apache.xerces.util.ObjectFactory.createObject(Unknown Source)
[mxmlc]     at org.apache.xerces.util.ObjectFactory.createObject(Unknown Source)
[mxmlc]     at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
[mxmlc]     at org.apache.xerces.parsers.SAXParser.<init>(Unknown Source)
[mxmlc]     at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
[mxmlc]     at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
[mxmlc]     at flex2.compiler.config.FileConfigurator.load(FileConfigurator.java:113)

Bedste reference


Når du løber tør for Permgen-rummet, skal du forsøge at hukommelse til rådighed ved at justere parametrene til JVM.


Jenkins.jenkins \ jenkins.xml indeholder serviceopsætningen til Windows-tjenesten: Her er en kopi af vores.


<service>
  <id>jenkins</id>
  <name>Jenkins</name>
  <description>This service runs Jenkins continuous integration system.</description>
  <env name="JENKINS\_HOME" value="\%BASE\%"/>
  <!--
    if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
    The following value assumes that you have java in your PATH.
  -->
  <executable>java</executable>
  <arguments>-Xrs -Xmx512m -XX:MaxPermSize=512m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "C:Hudson.hudsonjenkins.war" --httpPort=80</arguments>
  <logmode>rotate</logmode>
</service>


Parameteren -XX: MaxPermSize=512m blev tilføjet i sidste uge for at løse et problem, der ligner meget.