0

We are doing a performance test of our application. During the test, we find that non heap memory and total no of loaded classes keeps on increasing over the time.

Our guess is probably some 3rd party jar or application code is leaking.

What are the best ways to find such leak or pin point the problem ? Any tools which can help me to find the rootcause ?

We are using Jboss EAP 6.1.

Rips
  • 1,964
  • 1
  • 23
  • 45

3 Answers3

1

Make first Heap Dump by jvisualVm from JDK and analyze it with Memory Analyzer (MAT).

And then see in this direction at header 'Non-Heap': http://www.yourkit.com/

DmitryKanunnikoff
  • 2,226
  • 2
  • 22
  • 35
1

It sounds to me like something in your code could be continually creating new dynamic proxy classes. I think that that would give you a leak with the characteristics that you describe.

Other Q&A's explain general techniques for tracking down Java storage leaks; e.g.

I suggest you start by trying to identify the Class objects. I suspect that you will find that the off-heap memory allocations are associated with them; e.g. associated native code segments produced by the JIT compiler.

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
0

The JVM ships with a couple of tools that let you look at the contents of the heap ( jhat and jmap ). Using these may allow you to see why you are seeing more than the expected number of loaded classes.

I'd start there before trying to see the non-heap memory usage.

DaveH
  • 7,187
  • 5
  • 32
  • 53
  • I have been using tools like appdynamics,jconsole and I can say that heap doesnt seem to be an issue.heap utilization looks fine with proper GC cycles.thread count is also stable.Only thing which is a concern is of total no of classes loaded keeps on increasing which increases the non heap memory usage – Rips Mar 12 '14 at 10:38
  • Ok - we're getting passed my level of knowledge here, but where are these classes being loaded, if they aren't going on the heap? – DaveH Mar 12 '14 at 10:43
  • classes are loaded in permgen space which is outside the heap – Rips Mar 12 '14 at 12:39
  • I think that's another argument - PermGen can just as easily be considered a special segment of the heap. jmap -permgen will show you the contents of the permgen - that would still be the place I'd start. – DaveH Mar 12 '14 at 13:56