2

Why is the usage of the heap of my server steadily growing till a certain point and then it drops at a certain amount of heap usage (~270mb). I assume the drop is due to a garbage collection. But why is it growing although my server is doing nothing?



enter image description here

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
gosua
  • 1,017
  • 4
  • 15
  • 32
  • 2
    define 'doing nothing'. and what makes you believe that is the case? – mfsiega Jul 20 '12 at 16:21
  • What do you mean 'doing nothing'? Is it literally blocking a thread? Or is there some computation going on? – Joe Jul 20 '12 at 16:21

1 Answers1

7

It has jconsole connected to it. That produces some garbage to send you the data on how much memory is used.

If you use jvisualvm instead it will show you what objects are being created as well. I suspect it uses more garbage to monitor your application and jvisuavm can be the biggest memory user reported. ;)

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130
  • 3
    Yep, the good old heisenberg - observing changes the behavior. – Voo Jul 20 '12 at 16:25
  • @Joe Per minute. Never really looked into how much exactly jconsole needs alone, but that's conceivable, if a bit wasteful. – Voo Jul 20 '12 at 16:26
  • i tried it with a simple application which allocates some memory and then running forever. i am observing the same behavior. growing -> droping. b – gosua Jul 20 '12 at 16:50
  • Hi Peter Lawley, please share your thoughts in this question: http://stackoverflow.com/questions/34072070/java-1-7-45-how-to-get-full-heap-dump-of-process-instead-of-truncated-dump – Ravindra babu Jul 11 '16 at 15:18