简体   繁体   中英

Jenkins heap space

I'm running Jenkins on Windows 2016 server with the following defenitions in jenkins.xml:

-Xrs -Xmx2G -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"

But the problem that we get an error:

exception while collecting data: java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space  

and the server stuck.
After monitorung the master, we have seen that java heap is 512 and not 2G. How can it be? From the Master monitor screen:

OS: OS Windows NT (unknown), , x86/32 (4 cores)
Java:   Java(TM) SE Runtime Environment, 1.8.0_66-b18
JVM:    Java HotSpot(TM) Client VM, 25.66-b18, mixed mode   The server mode has much better performance than the client mode, you should consider using the server mode if your are not in development
PID of process: 7960
Server: Server jetty/9.2.z-SNAPSHOT
Webapp context: 
Start:  11/28/17 2:15 PM
JVM arguments:  -Xrs
-Xmx2G
-Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle
-Xmx512M
Mean age of http sessions (min):    6
Memory: Non heap memory = 83 Mb (Perm Gen, Code Cache),
Buffered memory = 0 Mb,
Loaded classes = 22,254,
Garbage collection time = 6,007 ms,
Process cpu time = 156,718 ms,
Committed virtual memory = 438 Mb,
Free physical memory = 13,245 Mb,
Total physical memory = 16,383 Mb,
Free swap space = 16,199 Mb,
Total swap space = 19,327 Mb

Please note that you have 2 options -Xmx in the monitor screen.

Beside verifying what's in jenkins.xml file, have a look at environment variable(s) like:

JAVA_OPTS , MAVEN_OPTS or ANT_OPTS .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM