What is perm space?

后端 未结 10 1757
日久生厌
日久生厌 2020-11-28 02:10

While learning about java memory profiling, I keep seeing the term \"perm space\" in addition to \"heap.\" I know what the heap is - what\'s perm space?

相关标签:
10条回答
  • 2020-11-28 03:08

    PermGen Space stands for memory allocation for Permanent generation All Java immutable objects come under this category, like String which is created with literals or with String.intern() methods and for loading the classes into memory. PermGen Space speeds up our String equality searching.

    0 讨论(0)
  • 2020-11-28 03:09

    What exists under PremGen : Class Area comes under PremGen area. Static fields are also developed at class loading time, so they also exist in PremGen. Constant Pool area having all immutable fields that are pooled like String are kept here. In addition to that, class data loaded by class loaders, Object arrays, internal objects used by jvm are also located.

    0 讨论(0)
  • 2020-11-28 03:12

    Simple (and oversimplified) answer: it's where the jvm stores its own bookkeeping data, as opposed to your data.

    0 讨论(0)
  • 2020-11-28 03:14

    It stands for permanent generation:

    The permanent generation is special because it holds meta-data describing user classes (classes that are not part of the Java language). Examples of such meta-data are objects describing classes and methods and they are stored in the Permanent Generation. Applications with large code-base can quickly fill up this segment of the heap which will cause java.lang.OutOfMemoryError: PermGen no matter how high your -Xmx and how much memory you have on the machine.

    0 讨论(0)
提交回复
热议问题