O Java ao contrário do C possui um layout de memória muito bem definido e especificado pela JSR 133. Estava estudando sobre isso e me deparei com a seguinte duvida:
Na wikipedia diz:
HeapThe Java Virtual Machine heap is the area of memory used by the JVM (and specifically HotSpot) for dynamic memory allocation[11]. The heap is split up into “generations”:
* The Young generation stores short-lived Objects that are created and immediately Garbage collected. * Objects that persist longer are moved to the Old generation (also called the Tenured generation). * The Permanent generation (or permgen) is used for class definitions and associated metadata.[12][13].There was originally no permanent generation, and Objects and classes were just stored together in the same area. But as class unloading occurs much more rarely than Objects are collected, moving class structures to a specific area allows significant performance improvements[12].
O heap da JVM é dividido em três áreas, sendo uma delas a permgen destinada a definições de classe e metadados associados. Logo em seguida é dito que não existe tal área e que objetos e classes são armazenados na mesma área, contudo o descarregamento de classes da memória é raro se comparado com a coleta de objetos.
Em outras literaturas vejo o conceito de Method Area
The method area and the program counter
The method area is where the bytecodes reside. The program counter always points to (contains the address of) some byte in the method area. The program counter is used to keep track of the thread of execution. After a bytecode instruction has been executed, the program counter will contain the address of the next instruction to execute. After execution of an instruction, the JVM sets the program counter to the address of the instruction that immediately follows the previous one, unless the previous one specifically demanded a jump.
Ou seja a Method Area é onde o código em linguagem intermediária, o bytecode é armazenado. Ou seja não é no heap muito menos em permgen.
Confuso, não?