What does PermGen actually stand for?
Asked Answered
M

8

128

I know what PermGen is, what it's used for, why it fails, how to increase it etc.

What I don't know is what PermGen actually stands for. Permanent... Gen... something?

Does anyone know what PermGen actually stands for?

Marcelmarcela answered 25/11, 2008 at 21:30 Comment(1)
[Good description][1] from the guy who knows a lot about GC internals. There are a plenty of useful GC-related info in his blog, by the way. [1]:blogs.oracle.com/jonthecollector/entry/…Hotspur
B
88

Permanent Generation. Details are of course implementation specific.

Briefly, it contains the Java objects associated with classes and interned strings. In Sun's client implementation with sharing on, classes.jsa is memory mapped to form the initial data, with about half read-only and half copy-on-write.

Java objects that are merely old are kept in the Tenured Generation.

Buttonhole answered 26/11, 2008 at 11:57 Comment(3)
"In JDK 7, interned strings are no longer allocated in the permanent generation of the Java heap": oracle.com/technetwork/java/javase/jdk7-relnotes-418459.htmlKopje
And in JDK 8 there is no permanent generation at all! It's fun to see this answer evolve over the years.Syncytium
@BrianGordon is correct.. For more information about that: https://mcmap.net/q/19829/-permgen-elimination-in-jdk-8Monge
B
61

PermGen is used by the JVM to hold loaded classes. You can increase it using:

-XX:MaxPermSize=384m

if you're using the Sun JVM or OpenJDK.

So if you get an OutOfMemoryException: PermGen you need to either make PermGen bigger or you might be having class loader problems.

Bromic answered 26/11, 2008 at 14:36 Comment(0)
A
20

Permanent Generation. See the java GC tuning guide for more details on the garbage collector.

Al answered 25/11, 2008 at 21:32 Comment(0)
A
8

Not really related match to the original question, but may be someone will find it useful. PermGen is indeed an area in memory where Java used to keep its classes. So, many of us have came across OOM in PermGen, if there were, for example a lot of classes.

Since Java 8, PermGen area has been replaced by MetaSpace area, which is more efficient and is unlimited by default (or more precisely - limited by amount of native memory, depending on 32 or 64 bit jvm and OS virtual memory availability) . However it is possible to tune it in some ways, by for example specifying a max limit for the area. You can find more useful information in this blog post.

Arrogate answered 17/6, 2014 at 11:51 Comment(0)
T
6

PermGen stands for Permanent Generation.

Here is a brief blurb on DDJ

Tomas answered 25/11, 2008 at 21:34 Comment(0)
K
3

Permanent generation

Kiser answered 25/11, 2008 at 21:33 Comment(0)
O
3

If I remember correctly, the gen stands for generation, as in a generational garbage collector (that treats younger objects differently than mid-life and "permanent" objects). Principle of locality suggests that recently created objects will be wiped out first.

Odle answered 25/11, 2008 at 21:34 Comment(0)
D
2

Permgen stands for Permanent Generation. It is one of the JVM memory areas. It's part of Heap with fixed size by using a flag called MaxPermSize.

Why the name "PermGen" ?

This permgen was named in early days of Java. Permgen mains keeps all the meta data of loaded classes. But the problem is that once a class is loaded it'll remain in the JVM till JVM shutdown. So name permgen is opt for that. But later, dynamic loading of classes came into picture but name was not changed. But with Java 8, they have addressed that issue as well. Now permagen was renamed as MetaSpace with dynamic memory size.

Dour answered 12/8, 2018 at 7:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.