in Technology by
Does Garbage collection occur in permanent generation space in JVM?

1 Answer

0 votes
by

This  is a tricky Garbage collection interview question as many programmers are not sure whether PermGen space is part of Java heap space or not and since it maintains class Meta data and String pool, whether its eligible for garbage collection or not. 

By the way Garbage Collection does occur in PermGen space and if PermGen space is full or cross a threshold, it can trigger Full GC. If you look at the output of GC you will find that PermGen space is also garbage collected. This is why correct sizing of PermGen space is important to avoid frequent full GC. You can control size of PermGen space by JVM options -XX:PermGenSize and -XX:MaxPermGenSize.

Related questions

0 votes
    Which of the following is a garbage collection technique? (a) Cleanup model (b) Mark and sweep model ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What happens to the thread when garbage collection kicks off? (a) The thread continues its operation (b) ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    Which of these methods initiates garbage collection? (a) gc() (b) garbage() (c) garbagecollection() ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    When Overloading does not occur? (a) More than one method with same name but different method signature and ... questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is -Xms and -Xmx while starting jvm? (a) Initial; Maximum memory (b) Maximum; Initial memory ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 26, 2021 in Education by JackTerrance
0 votes
    What is JVM? (a) Bootstrap (b) Interpreter (c) Extension (d) Compiler This question was addressed ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    What is Garbage Collection in C#.Net?...
asked Jul 27, 2021 in Technology by JackTerrance
0 votes
    What is the purpose of garbage collection? (a) Removes object with many reference (b) Removes object with ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    Which of these process occur automatically by the java runtime system? (a) Serialization (b) Garbage ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these process occur automatically by java run time system? (a) Serialization (b) Memory allocation ( ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these standard collection classes implements a dynamic array? (a) AbstractList (b) LinkedList (c) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Map implements collection interface? (a) True (b) False I have been asked this question in an international ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Is hashmap an ordered collection. (a) True (b) False I had been asked this question during an ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these standard collection classes implements a linked list data structure? (a) AbstractList (b) ... questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of these packages contain all the collection classes? (a) java.lang (b) java.util (c) java. ... programming questions and answers pdf, java interview questions for beginners...
asked Oct 25, 2021 in Education by JackTerrance
...