1.java application JVM principle and parameter tuning

Source: Internet
Author: User
Tags xms

What is a JVM?

Virtual machine, byte code, platform Independent

The JVM divides the memory structure according to the storage structure of the runtime data, and the JVM divides them into several different data formats when operating Java programs, which are stored in different regions, which are collectively known as runtime data. Runtime data includes the data information of the Java program itself and the additional data information that the JVM needs to run Java.

JVM Heap Configuration parameters

1-xms Initial Heap Size

1/641 of default physical memory (<1G)

2-XMS Maximum Heap Size

The default physical memory of the quarter (<1GB), the actual recommendation is not less than 4G.

3 General recommended settings-xms=-XMX

The benefit is to avoid resizing the heap every time after GC, reducing the system memory allocation overhead

4 size of the entire heap = young generation size + old generation size + persistent generation size.

JVM Memory Structure

New generation of JVM (young generation)

Cenozoic = 1 Eden Zone + 2 survivor area

-xmn Young generation size (1.4 or Lator)

-xx:newsize,-xx:maxnewsize (set young generation size (for1.3/1.4))

The default size is 3/8 of the entire heap

-xx:newratio

Ratio of young generations (including Eden and two survivor districts) to older generations (excluding persistent generations)

Xms=xmx and the xmn is set, this parameter does not need to be set.

-xx:survivorratio

The ratio of the Eden area to the Survivor area is set to 8, then the ratio of two survivor area to one Eden area is 2.8, and one survivor area represents 1/10 of the entire young generation.

Used to store Java objects just allocated by the JVM.

Java Persistence generation (perm Generation)

1. Generation = Entire Heap-young generation size-old age size

1.

1.java application JVM principle and parameter tuning

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.