0

I'm currently running Jenkins on a mac mini with Xmx2048m set and a permgen space of 512, I have the 'Monitoring' plugin running and it shows Jenkins using ~200M memory (spiking at 400 during archives). This number is slowly creeping up as you can see below.

https://i.stack.imgur.com/BtAtC.png

When I look at the java process using 'top' on the mac mini it is showing the memory at about 685M. This number creeps up quicker and, eventually, hits 2048 and Jenkins bombs out.

https://i.stack.imgur.com/W31vb.png

When I reboot the machine, or restart Jenkins, the 'top' recording drops back to around 270M and the java monitor drops to around 150M. What could be causing the difference in these readouts?

Is there a way to determine what exactly is causing the memory leak? I'm assuming it's a plugin and, due to the leak being continuous rather on a 'per-build' basis, I'm inclined to think it's perforce polling or something similar.

Any assistance would be greatly appreciated.

user3825108
  • 21
  • 1
  • 3
  • 1
    I can recommend the blog series http://java.jiderhamn.se/category/classloader-leaks/ – Leonard Brünings Jul 10 '14 at 11:35
  • If you are serious about this, read http://stackoverflow.com/questions/40119/how-to-find-a-java-memory-leak. But you will need to do quite a bit of work ... – Stephen C Jul 10 '14 at 11:39
  • @LeonardBrünings - No evidence has been presented to suggest that this a classloader-related memory leak ... as distinct from the other kinds of memory leak. – Stephen C Jul 10 '14 at 11:42
  • @StephenC I know but the series also gives general information on how to acquire and analyse a HeapDump. – Leonard Brünings Jul 10 '14 at 12:19

2 Answers2

1

Have you tried to make a Thread dump and analyze where the memory is being used ?

Another way to figure out what is causing the problem might be looking in jenkins logs.

If you are using Tomcat as your server you could try to add monitor for memory leaks, more here

wsl
  • 8,875
  • 1
  • 20
  • 24
  • I've had a look at the thread dump but it goes over my head a bit, I need to do a bit more digging. There are a Tonne of errors in the Jenkins log, similar to: SEVERE: Could not find record type for index: -1 – user3825108 Jul 10 '14 at 11:32
0

You already suspect a plug-in to be the leaker, so why don't you deactivate one plug-in at a time and see if the leaking stops?

I don't how many plug-ins you've installed, but you should try to search for memory leak + plug-in name, maybe someone else had the same problem.

s3b
  • 158
  • 1
  • 10