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

Does Garbage collection occur in p...

Câu trả lời

Yes, garbage collection does occur in the permanent generation space in the JVM. The permanent generation, or PermGen, is a special heap space that is separate from the main memory heap and is used to store metadata required by the JVM to describe the classes and methods used in the application. It is populated at runtime with these application classes, as well as Java SE library classes and interned strings.

Garbage collection in the PermGen space is responsible for removing classes that are no longer in use, which can happen during a full garbage collection cycle. This is important because it helps to prevent memory leaks and ensures that memory is available for new classes that the application may load in the future.

However, it's worth noting that in Java 8, the PermGen space was removed and replaced with a new memory area called Metaspace, which is not part of the Java heap and is allocated out of native memory. The Metaspace performs a similar function to the PermGen but is managed differently and can dynamically...

expert

expert

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

middle

What is the Java Classloader?

middle

What's the advantage of using getters and setters?

senior

When to use LinkedList over ArrayList in Java?

Bình luận

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

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