[英]Jenkins heap space
我在Windows 2016服務器上運行Jenkins,並在jenkins.xml中使用以下版本:
-Xrs -Xmx2G -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"
但是我們得到錯誤的問題是:
exception while collecting data: java.lang.OutOfMemoryError: Java heap space java.lang.OutOfMemoryError: Java heap space
而服務器卡住了。
在監控主人之后,我們已經看到java堆是512而不是2G。 怎么可能? 從主監視器屏幕:
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
請注意,顯示器屏幕上有2個選項-Xmx
。
除了驗證jenkins.xml文件中的內容之外, 還要查看環境變量,如:
JAVA_OPTS
, MAVEN_OPTS
或ANT_OPTS
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.