5

The problem is this: I have observed, that the CPU usage is 100% while running a build. The builds duration is ca. 2 hours. If the build ends the usage of jenkins is still 80-85%. After this I restart the jenkins service. The CPU usage was 5%. I started the same build and its duration was 38 minutes. While running the build, the usage was 100%, but for this task it is okay if the duration is 38minutes. For 7 clock this morning the CPU usage is 80% again. I don't start a build at this time. If I build the project its duration is 2h already. In this projects are 3 jobs. The duration of the others are 20-25 minutes.

Maybe someone can find the Problem. Tell me, if some information are necessary.

Jenkins version: 1.590 Server: Windows 7 , 32bit

Jonas
  • 61
  • 2
  • 7
  • Is it on master or slaves? Anyway, it depends on many factors like number of installed plugins, job definition, or even source code. – Ekk Jul 17 '15 at 09:08
  • There are 26 plugins. It is on a master. – Jonas Jul 17 '15 at 09:31
  • Do you use all of them? If not, you may want to disable ones you don't use. – Ekk Jul 17 '15 at 11:24
  • You will most probably find the culprit with [Java Flight Recorder and Java Mission Control.](http://www.oracle.com/technetwork/java/javaseproducts/mission-control/index.html). – Gerold Broser Jul 18 '15 at 15:33
  • I've tried Java Mission Control but i don't know how to use it. The program says that the JVM CPU Usage is 0%. The machine CPU Usage is 85%. When i looke at the threads, there is no thread which needs more of 0,5% of the CPU Usage – Jonas Jul 24 '15 at 06:18
  • It seems to be the problem that i can't connect to the right jvm. In the task manager the PID 2584 is the java.exe process with the high usage. If i start the jmc the PID 2584 is shown on the left side, but i cant connect to it. I'm only able to connect to "The JVM Running Mission", but there the jvm usage is 0%. Connection State is Unconnectable. If i start the jmc console i get the error message "could not open PerfMemory". – Jonas Jul 24 '15 at 08:14

2 Answers2

2

In my case, it was the 'Asynchronous resource disposer' plugin/feature used by Jenkins to cleanup resources. The Asynchronous resource disposer was not able cleanup the workspace leaving behind heap of directories similar to 'JOB_NAME_ws-cleanup_1599802799143'. When I stopped the Disposer to track the orphan workspaces(which were around 20) the CPU usage came back to normal. You will find this option under, 'Manage Jenkins' -> 'There are resources Jenkins was not able to dispose automatically. Click Manage' -> Stop tracking. Off-course, the permanent solution was to fix Workspace Cleanup Plugin to successfully delete the workspaces. Ref- Why is Jenkins suddenly unable to delete a workspace

funny_head
  • 91
  • 1
  • 5
  • This turned out to be my issue also, thanks! In my case, the workspace was not being deleted due to a 'permission denied' error since one of the files was owned by the wrong user. – Josh Yolles Nov 04 '21 at 18:32
  • Exactly what happened to me. Thanks for your help! – Moshe May 02 '23 at 21:42
1

I've solve the problem. The problem was my antivirus program. I uninstalled it and the usage is the whole day 0-1%.

Jonas
  • 61
  • 2
  • 7