Runtime memory management

At execution time, the Java virtual machine (JVM) must handle different parts of memory:
  • the part that contains the Java bytecode (i.e., the code that is executed by the JVM) -
    • determined at execution time when the class is loaded into the JVM
    • the dimension is fixed for each method at compilation time
  • heap: part of memory that contains the objects -
    • dynamically grows and shrinks during execution
    • each object is allocated and deallocated independently from the other objects
  • stack of activation records: part of memory for the data local to methods (variables and parameters) -
    • dynamically grows and shrinks during execution
    • is managed in the form of a stack (Last-In-First-Out strategy)

No comments:

Post a Comment