Questions tagged [permgen]

In the Java Virtual Machine, the permanent generation (or permgen) is used for class definitions and associated metadata.

In the Java Virtual Machine, the permanent generation (or permgen) is used for class definitions and associated metadata.

References:

337 questions
12
votes
3 answers

Is java PermGen space part of the total VM memory?

Assuming I start my java VM with the following parameters: -Xms1024m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m Do the 512m PermGen space add to the 1024m memory or are they part of it? Or in other words, do I have a total memory consumption…
Jörg Brenninkmeyer
  • 3,304
  • 2
  • 35
  • 50
12
votes
2 answers

How do I estimate a class's total permgen memory consumption?

Recently, I was writing a class in which I discovered that I could reduce memory consumption of instances by ~10 bytes/element, but only at the cost of making the code much more complex. This increased the size of the compiled .class file by…
Louis Wasserman
  • 191,574
  • 25
  • 345
  • 413
11
votes
1 answer

Doesn't Clojure consume too much perm-gen space?

I'm new to Cojure, but I read that when using AOT compilation a class is generated for each function. Wouldn't that mean a whole lot of classes that consume perm-gen space? Aren't there any issues with that? What about when AOT compilation is not…
cretzel
  • 19,864
  • 19
  • 58
  • 71
11
votes
5 answers

java.lang.OutOfMemoryError: PermGen space on web app usage

I am struggling with an outOfMemory PermGen issue that has been showing up recently. One of the log snippets that was saved when error appeared: java.lang.OutOfMemoryError: PermGen space at java.lang.ClassLoader.defineClass1(Native Method) …
Lukasz
  • 111
  • 1
  • 3
11
votes
8 answers

How do I discover what is in the permanent generation

Given a heapdump or a running VM, how do I discover what the contents of the permanent generation is ? I know about 'jmap -permstat' but that's not available on Windows.
Tom
  • 55,743
  • 3
  • 27
  • 35
11
votes
3 answers

Set the permgen size for the Child JVM processes that Maven will spin off

I am building a Maven Java app on a Jenkins build server. I am running into java.lang.OutOfMemoryError: PermGen space many times during the build on Jenkins (but never on my localhost) and hence it fails my build. I have already tried setting…
ecbrodie
  • 11,246
  • 21
  • 71
  • 120
10
votes
1 answer

Programmatically fill the JVM Permanent Generation (PermGen) memory region

I need to test some JMX monitoring scripts I have developed, In particular I would like to verify that my monitoring of the PermGen region is working. So in order to test this I would like to be able to run a bit of code that loads a significant…
Gareth Davis
  • 27,701
  • 12
  • 73
  • 106
10
votes
2 answers

Locating code that is filling PermGen with dead Groovy code

We have had our glassfish instance go down every two weeks for a while with a java.lang.OutOfMemoryError: PermGen space. I increased the PermGen space to 512MB and startet dumping memory usage with jstat -gc. After two weeks I came up with the…
oligofren
  • 20,744
  • 16
  • 93
  • 180
10
votes
2 answers

Do I have a JAXB classloader leak

I have an application deployed on Glassfish. Over time the number of loaded classes climbs into the millions and my permgen seems to rise. To help troubleshoot I added the following to my jvm…
Preston
  • 3,273
  • 4
  • 26
  • 35
10
votes
1 answer

Why Spring Context not gracefully closed?

On stop or undeploy/redeploy of a Spring framework 3.0.5 based web application following error is logged in Tomcat7's catalina.out: SEVERE: The web application [/nomination##1.0-qa] created a ThreadLocal with key of type [java.lang.ThreadLocal]…
10
votes
2 answers

Java 7 fails to collect permanent generation which is collected by java 5

Does anybody know why java 7 fails to collect permanent generation of app, resulting in java.lang.OutOfMemoryError: PermGen, while java 5 collects the permanent generation and app runs well? App does evaluation of jython expressions in the loop, one…
user555945
9
votes
1 answer

When does the perm gen get collected?

I work on a Tomcat application which uses the CMS collector along with a memory bar to trigger GC. When I reload webapps I sometimes end up in a situation where the Old gen is full enough to trigger GC but the dead Classloaders don't get collected.…
mchr
  • 6,161
  • 6
  • 52
  • 74
9
votes
3 answers

JUnit 4 PermGen size overflow when running tests in Eclipse and Maven2

I'm doing some unit tests with JUnit, PowerMock and Mockito. I have a lot of test classes annotated with @RunWith(PowerMockRunner.class) and @PrepareForTest(SomeClassesNames) to mock final classes and more than 200 test cases. Recently I've run…
BlueLettuce16
  • 2,013
  • 4
  • 20
  • 31
8
votes
1 answer

Are there any benefits to keeping MaxPermSize small?

Assuming a 64-bit JVM, is there any significant benefit to keeping MaxPermSize small? This is in the context of a Java EE application that is frequently redeployed, and has a classloader leak. As a medium-term workaround, it seems very reasonable…
Ed Staub
  • 15,480
  • 3
  • 61
  • 91
8
votes
5 answers

Is permanent generation part of the heap or does it lies in a different space of itself in jvm

I have seen multiple comments regarding this question - some say yes and some say no, and many of the answers are ambiguous. Can anyone please describe in simpler terms where it resides? In one post I even saw someone say that it shares the same…
Nav
  • 10,304
  • 20
  • 56
  • 83
1 2
3
22 23