Structure of Heap

首先这有一个说的挺清晰的帖子:

http://stackoverflow.com/questions/2129044/java-heap-terminology-young-old-and-permanent-generations

For the HotSpot Java VM, the memory pools for serial garbage collection are the following.

  • Eden Space (heap): The pool from which memory is initially allocated for most objects.
  • Survivor Space (heap): The pool containing objects that have survived the garbage collection of the Eden space.
  • Tenured Generation (heap): The pool containing objects that have existed for some time in the survivor space.
  • Permanent Generation (non-heap): The pool containing all the reflective data of the virtual machine itself, such as class and method objects. With Java VMs that use class data sharing, this generation is divided into read-only and read-write areas.
  • Code Cache (non-heap): The HotSpot Java VM also includes a code cache, containing memory that is used for compilation and storage of native code.
说明:

native code指在虚拟机中保存的一部分最常被执行的机器码,这样当同样的字节码被调用时,就直接使用缓存的机器码,从而省去了将字节码翻译成本地机器码的过程,提高了效率。

在上文中提到的generation,其实是和java中的garbage collection紧密相关的。逻辑上generation分别为:

young generation, old generation(or tenured generation) and permanent generation.


你可能感兴趣的:(Structure of Heap)