2

I am having problems with the heap memory of my application and I try to use VisualVM in order to find the memory leaks. There is something that I don't manage to understand. In the tab "Sampler", when I press the Memory button, I see a few thousands classes, having instances. If I do the same thing in the "Profiler" tab, I see much fewer classes, and this time they are "Alive Classes". If I look in the Monitor Tab, I see over 10.000 classes at Total Loaded. Can you help me with this? Also, if I have more than 1 instance for a class, is there any way to find out more about this instance?

Thank you.

Cristian
  • 61
  • 1
  • 1
  • 4

1 Answers1

3

I would recommend that you do a heapdump to see more information - the live views is not that good for that.

To do a heap dump:

  1. Locate your application in the application list(/tree)
  2. Right click on it and take heap dump

Or click on monitor and "heap dump" (up to the right):

dacwe
  • 43,066
  • 12
  • 116
  • 140
  • I have the heap dump now and I opened it in Memory Analyzer. After the Leak Suspects test I have only this: The classloader/component "sun.misc.Launcher$AppClassLoader @ 0x9750468" occupies 9,540,792 (74.72%) bytes. The memory is accumulated in one instance of "java.lang.Object[]" loaded by "" Do you think that it can have something to do with my memory leaks, too many classes are loaded and not unloaded? Maybe you can suggest other places to look. Also, The number of Class Loaders is 785 and the number of instances is over 250.000, even if my application is in idle now. – Cristian Nov 11 '10 at 12:27
  • Hum, what kind of application is it? – dacwe Nov 13 '10 at 12:11