Memory in Java

July 5, 2010 under Java

As I had to study their operation, I decided to post about the basic concepts of memory in Java.

To begin wtih, Java divides memory into two distinct segments:

  • Heap: User objects, variables, …
  • Non-Heap/Perm: code, metadata, …

The one that interests us is the Heap, as it is what we can “control”. You can configure the Non-Heap Memory (Perm) size with the parameter MaxPermSize. But this is only useful if the application is loaded or dynamically generate many different classes.

The heap is divided into two generations according to their lifetime:

  • Young Generation
  • Old Generation

Usually the younger generation is composed of local variables and temporary objects, while the older generation usually consists of structures that are necessary during the execution: configurations, viewports, …
Click here to read more.. »

Related Posts: