本篇文章主要介绍了"JVM中将MethodArea 作为PermannentArea管理的弊端"，主要涉及到JVM中将MethodArea 作为PermannentArea管理的弊端方面的内容，对于JVM中将MethodArea 作为PermannentArea管理的弊端感兴趣的同学可以参考一下。
在HotSpot JVM的设计中, Method Area部分是用PermanentGeneration 来指代和管理的，PermanentGeneration包含类信息，常量，静态变量，字符串常量池等。
Eden Space (heap)
Survivor Space (heap)
Tenured Generation (heap)
Permanent Generation (non-heap)
对于HotSpot虚拟机，根据JDK 1.7 的发布信息，已经把原本放在永久代中的字符串常量池移出。
Move part of the contents of the permanent generation in Hotspot to the Java heap and the remainder to native memory.
Hotspot’s representation of Java classes (referred to here as class meta-data) is currently stored in a portion of the Java heap referred to as the permanent generation. In addition, interned Strings and class static variables are stored in the permanent generation. The permanent generation is managed by Hotspot and must have enough room for all the class meta-data, interned Strings and class statics used by the Java application. Class metadata and statics are allocated in the permanent generation when a class is loaded and are garbage collected from the permanent generation when the class is unloaded. Interned Strings are also garbage collected when the permanent generation is GC’ed.
The proposed implementation will allocate class meta-data in native memory and move interned Strings and class statics to the Java heap. Hotspot will explicitly allocate and free the native memory for the class meta-data. Allocation of new class meta-data would be limited by the amount of available native memory rather than fixed by the value of -XX:MaxPermSize, whether the default or specified on the command line.
Allocation of native memory for class meta-data will be done in blocks of a size large enough to fit multiple pieces of class meta-data. Each block will be associated with a class loader and all class meta-data loaded by that class loader will be allocated by Hotspot from the block for that class loader. Additional blocks will be allocated for a class loader as needed. The block sizes will vary depending on the behavior of the application. The sizes will be chosen so as to limit internal and external fragmentation. Freeing the space for the class meta-data would be done when the class loader dies by freeing all the blocks associated with the class loader. Class meta-data will not be moved during the life of the class.