-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
* Environment: Windows 2003 with Linux-slaves.
* Version: 1.434
* Parameters: -Xrs -Xmx1536m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dhudson.upstreamCulprits=true -jar "%BASE%\hudson.war" --httpPort=8080
* Plugins: Active Directory 1.18, Static Code Analysis 1.28, CVS 1.5 (not used - using SVN), Configuration Slicing 1.22, Instant Messaging 1.18, JIRA 1.28, Transation Assistance 1.7.* Environment: Windows 2003 with Linux-slaves. * Version: 1.434 * Parameters: -Xrs -Xmx1536m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -Dhudson.upstreamCulprits=true -jar "%BASE%\hudson.war" --httpPort=8080 * Plugins: Active Directory 1.18, Static Code Analysis 1.28, CVS 1.5 (not used - using SVN), Configuration Slicing 1.22, Instant Messaging 1.18, JIRA 1.28, Transation Assistance 1.7.
I run frequent scripts on a node called "utils" using the groovy CLI to communicate with Jenkins. After a couple of hours, the CLI stops working. I've found several java.lang.OutOfMemoryError: unable to create new native thread in the log file. I've checked the memory and it uses 500 mb out of 1.5gb allocated. I searched the net and found that it could be caused by too many threads.
I've done a thread dump and found that the node called "utils" has 1074 threads that look like this:
ComThread for Thread-1022
"ComThread for Thread-1022" Id=1497 Group=main RUNNABLE (in native)
at com4j.Win32Lock.suspend0(Native Method)
at com4j.Win32Lock.suspend(Win32Lock.java:33)
at com4j.ComThread.run0(ComThread.java:135)
at com4j.ComThread.run(ComThread.java:125)
Finally, Jenkins crashes with out of memory. Attached is the thread dump.
Any ideas? It started around the time when I finally understood how the groovy CLI scripts work and added a few of them.
-------------------
The groovy scripts I run are:
Thread.getAllStackTraces().keySet().each() { item -> if (item.getName().contains("SCM polling") && item.getName().contains("waiting for hudson.remoting")) { println "Interrupting thread " + item.getId(); item.interrupt() } }
def slaves = hudson.model.Hudson.instance.getNodes() for (slave in slaves) { def comp = slave.getComputer() def executors = comp.getExecutors() if (executors != null ) { for (executor in executors) { def workunit = executor.getCurrentWorkUnit() if (workunit != null) { def subtask = workunit.work println "Slavename:" + slave.getDisplayName() + ";Task:BUSY:" + subtask.getDisplayName() } else { println "Slavename:" + slave.getDisplayName() + ";Task:IDLE" } } } }
def slaves = hudson.model.Hudson.instance.getNodes() for (slave in slaves) { def comp = slave.getComputer() if (comp.isOnline()) { println "Name:" + comp.getName() + "; Status: ONLINE; Hostname:" + comp.getHostName() + "; Idle:" + comp.countIdle() } else{ println "Name:" + comp.getName() + "; Status: OFFLINE; Hostname:NA" + "; Idle:0" } }
- is related to
-
JENKINS-16429 ComThread is leaking even when its peer is dead
- Resolved