PermGen and Heap, Difference and their significance

后端 未结 5 518
闹比i
闹比i 2021-02-01 23:19

Friends,

Can you please give me significance, difference and uses for Heap and PermGen. Also it would be good to know what class are loaded in them respectively.

5条回答
  •  孤城傲影
    2021-02-01 23:45

    Well i'm no expert, but the PermGem memory resides within the Heap, since its like a special place where all the classes are loaded at runtime. So if you have too many classes, the PermGem throws an OutOfMemoryException. And well the heap stores the objects you instanciate within your java code, where the GC collects the objects that are not referenced by any variable in a running thread in the stack.

提交回复
热议问题