How can I find out what is stored in PermGen?

I have a PermGen memory error in my application, and I want to see what led to it.

I connected to my application through VisualVM.

I want to see what exactly consumes so much PermGen memory in my application, but I cannot take the special "PermGen heap" in VisualVM. I can use the standard HeapDump.

Is it possible to find out what exactly consumes all of my PermGen memory using VIsualVM or some other tool?

UPDATE This question has been marked as "duplicate", but in fact I do not see the answer to my question in the mentioned topic. The problem is that I don’t see a way to accurately list what consumes memory in my space with a pergene.

Currently, from this thread, I know the following tips:

  • Run jmap -permstat and see what part of PermGen is used by static strings . Good idea, it works: now I know that String Pool is not a problem in my case.

  • Run jmap -permstat and see how memory is consumed by class loaders . It works, but there are hundreds of classes in AppClassLoader, it doesn't help me much.

  • Run PrintStringTable.java to see which lines take up memory . I cannot run it on my Windows 7 PC because I get

Joining process identifier XXXX, please wait ... Error connecting to Process: timeout occurs while trying to connect to the debug server (please run SwDbgSrv.exe).

Whatever it is, it's none of my business.

  1. , JVM. , , , .

. , PermGen , . , ?

, , .

+4

All Articles