Câu hỏi phỏng vấn Java
Câu hỏi

What is Perm Gen...

Câu trả lời

PermGen space, short for Permanent Generation space, is a special memory region in the Java Virtual Machine (JVM) used to store metadata describing user classes (classes that are not part of the Java language itself). It is distinct from the main Java heap where the JVM stores instance data. PermGen space is used to store class structures such as the runtime constant pool, field and method data, and the code for methods and constructors, as well as interned strings and static class variables[1][2][3][4][5][6][7][8].

Prior to Java 8, PermGen was a fixed size and was part of the Java heap. It was notorious for causing java.lang.OutOfMemoryError: PermGen space errors if the space allocated to it was insufficient to hold all the class information required by an application. This was particularly a problem in environments where many classes are loaded and unloaded in the JVM, such as in web servers running multiple applications[1][2][3][4][5][6][7][8].

In Java 8, PermGen was replaced by Metaspace, which performs a similar function but is allocated out of native memory, separate from the Java heap. Metaspace can grow dynamically, which helps avoid out-of-memory errors related to class metadata storage. The transition to Metaspace also allows for more efficient garbage collection and memory management[1][2][3][4][5][6...

senior

senior

Gợi ý câu hỏi phỏng vấn

middle

Does Java support multiple inheritance?

middle

What are the differences between '==' and equals in java?

middle

What’s a deadlock?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào