-3

I'm studying about JDK 7 JVM's Runtime Data Areas.

I want to compare JDK 7 JVM and JDK 8 JVM. There are some memory areas in JDK 7 JVM, but I'm confused.

I'm looking for JDK 7 JVM Runtime Data Areas Architecture picture and articles in blogs, but all of articles saying different.

  1. Heap (including Young Generation, Old Generation)
  2. Method Area (where is located in JVM? heap? non-heap? native memory? or independent?)
  3. Runtime Constant Pool in Method Area
  4. JVM Stack in Native Memory
  5. Native Method Stack in Native Memory
  6. PC Register in Native Memory

But I'm confused about PermGen's location in Runtime Data Areas.

someone telling PermGen is part of Method Area.

someone telling Method Area is part of PermGen.

someone telling PermGen is non-heap. (then PermGen is located in Native Memory? then Runtime Data Areas separated 3 parts? (Heap, non-Heap(Method Area), Native Memory))

someone's picture telling PermGen is part of Heap enter image description here

What is correct?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
god_teemo
  • 11
  • 2
  • 1
    I'm curious as to why you care? At the end of the day it's all memory allocated from the OS and mapped through the MMU or some similar mechanism. The name that people choose to give to it doesn't matter all that much. – PiRocks Mar 07 '20 at 19:59
  • 1
    Perhaps it would also help if you linked/quoted the contradictory information you are finding online. – PiRocks Mar 07 '20 at 20:01
  • 3
    Lastly the JVM spec doesn't mention any of these terms, and lets the JVM implementation do more or less whatever it wants. So perhaps it would be best if you limited the scope of this question to a specific JVM, like hotspot, etc. – PiRocks Mar 07 '20 at 20:02
  • 1
    “Heap memory” and “non heap memory” do not differ technically. It’s the same kind of RAM allocated from the same process. There are technical aspects, people might consider typical for either type, but as soon as this categorization doesn’t work, like in the “PermGen” case, there is no point in discussing which category it belongs to. It would be more useful to discuss the particular technical aspect you are interested in. – Holger Mar 09 '20 at 11:58

1 Answers1

1

If you differentiate simply between Heap and Native memory PermGen is part of the Heap area. So is the method area.

The image you've attached is basically right in this regard.

Hotspot VM Heap areas

In the Hotspot-VM Permanent Generation (PermGen) is/was one of the Heap areas.

It is, however, a special heap space separated from the main memory heap. It is not affected by Java options like -Xmx or -Xms and has it's own limits and garbage collection behavior. Therefore one could also say it is non-heap depending on the viewpoint and context.

Roland Kreuzer
  • 912
  • 4
  • 11