Method Area



  • JVM has a method area, It is shared across all the Threas of the JVM.
  • Method area stores compiled code.
  • Method area is getting created at the JVM start time.
  • Method ares stores class strucure
  • -runtime constant pool
  • -fields
  • -method data
  • -constructors etc
  • The allocated memory for the method area is not required to be contiguous.
  • This method area is either of fixed size or it can be enlarge as per the computation.
  • The memory consumed by the method area is not garbage collected or it not be compacted after allocated.
  • If required memory space is not available for method area then JVM will give your OutOfMemoryError.