Memory allocation during class loading

Possible Duplicate:
static allocation in java - heap, stack and permanent generation

Looking to understand what EXACTLY happens (in terms of memory management) when a class is loaded by JVM. Specifically:

  • Which part of memory is the actual class byte code loaded/placed?
  • Which part of memory are the static variables loaded/placed?
  • Which part of memory are the other variables and methods loaded/placed?

  • At first the byte array containing the class is loaded into PermGen.

    Then the classes byte array is parsed and some parsed information is placed into PermGen, too.

    Then the Strings in the class are internalized (and placed into PermGen).

    When the class is initialized, all static variable instances are placed on the heap.

    When functions are called more often than a given threshold, the code for the JIT-compiled functions is placed into PermGen, too.

    That should be all, AFAIK, but I am not a JVM developer.

    链接地址: http://www.djcxy.com/p/82852.html

    上一篇: 在Java中存储静态方法和静态变量在哪里?

    下一篇: 在类加载期间的内存分配