Java Memory Architecture Model

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.