Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to output all the contents in Java constant pool (area of String.intern())? [duplicate]

Tags:

java

permgen

I want to get a dump of the PermGen to see why it is filling. Is there a way to analyze this? I already know about the common suspects like log4j, tomcat webapp reloading etc, but I have some custom proxy generation code in my application, too, and just want to look under the hood.

Is this possible somehow?

like image 477
Daniel Avatar asked Nov 23 '22 15:11

Daniel


1 Answers

The PermGen normally consists of the string literal pool and loaded classes. To answer part of your problem, i.e. the string literal pool I wrote a utility to print a running JVM's string literal pool. It is available here:

https://github.com/puneetlakhina/javautils/blob/master/src/com/blogspot/sahyog/PrintStringTable.java

It is based on PermStat, which is the class used to print permgen stats by the jmap tool.

like image 136
Puneet Avatar answered Nov 25 '22 06:11

Puneet