In order to facilitate the management of memory space, the JVM makes full use of memory space and divides the used memory space into the following areas, each of which contains only specific information.
Heap:Store Information: all objects and ArraysThis area of memory is divided into the new generation, the old age. New generation is used to store newly created objects,Older objects are stored in the old age, and multiple GC objects are not recycled. The new generation is divided into three regions: Eden: The object that just came out, S0 1: At least once a GC survived. The purpose of this distinction is to quickly select the objects to be recycled for garbage collectionAll Threads Sharethrown when memory overflows: OutOfMemoryErrorSet the memory block size:-xms512m-xmx1024m
Stack:Store Information: Local variables of the method, partial results, and participation in method invocation and returnstack is divided into, virtual machine stack and local method stack: The difference is not big, the local method stack, mainly native method used to memory space, this part is implemented by C language. Each thread will have a private stack spacethrown when memory overflows: Stackoverflowerror and OutOfMemoryErrorSet the memory block size:-XSS 1M
Persistent Generations:Store Information: The metadata of the class, such as the full name of the class, the full name of the parent class, the type modifier, the method information of the class, and so onSet the memory block size:-xx:permsize=256m-xx:maxpermsize=512m
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Java Memory Architecture Model