Java Virtual Machine Learning 3, Common JVM command parameters

Source: Internet
Author: User

Then write the things will use the virtual machine parameters, now here to send a total of their usual use, see some of the virtual machine parameters. It doesn't matter if you can't understand it now, but it will be used after all:

(1)-xms20m

Indicates that the minimum value for setting the heap capacity is 20M and must be in M

(2)-xmx20m

Indicates that the maximum value for setting the heap capacity is 20M, which must be in M. Setting-xmx and-XMS to the same can prevent the heap from automatically expanding. Large projects-xmx and-XMS are generally set to 10G, 20G or even higher

(3)-VERBOSE:GC

Indicates the details of the GC in the output virtual machine

(4)-xss128k

Indicates that the size of the virtual machine stack can be set to 128k

(5)-xoss128k

Indicates that the size of the local method stack is set to 128k. However, hotspot does not differentiate between the virtual machine stack and the local method stack, so this parameter is not valid for hotspot

(6)-xx:permsize=10m

Represents the capacity of the JVM for the initial allocation of the permanent generation, which must be in m units

(7)-xx:maxpermsize=10m

Represents the maximum capacity of the JVM to allow the allocation of permanent generations, which must be in M, and in most cases this parameter defaults to 64M

(8)-XNOCLASSGC

Represents a garbage collection of classes by the shutdown JVM

(9)-xx:+traceclassloading

Represents viewing load information for a class

(Ten)-xx:+traceclassunloading

Represents the uninstall information for the view class

(one)-xx:newratio=4

Indicates a young generation: the size ratio of the old age is 1:4, which means that the young generation accounts for 1/5 of the entire heap.

(-xx:survivorratio=8)

Represents the setting of 2 survivor Zones: 1 Eden areas have a size ratio of 2:8, which means that the survivor area accounts for 1/5 of the entire young generation, and this parameter defaults to 8

(-xmx20m)

Indicates that the size of the young generation is set to 20M

(-xx:+heapdumponoutofmemoryerror)

Indicates that the virtual machine can dump the current heap memory dump snapshot when a memory overflow exception occurs

(-XX:+USEG1GC)

means to have the JVM use the G1 garbage collector

(-xx:+printgcdetails)

Indicates that GC specifics are printed on the console

(+)-XX:+PRINTGC

Indicates that GC information is printed on the console

(-xx:pretenuresizethreshold=3145728)

Indicates that the object is larger than 3145728 (3M) and is directly into the old age allocation, where only bytes are used

(-xx:maxtenuringthreshold=1)

Indicates that the object age is greater than 1 and automatically enters the old age

(-xx:compilethreshold=1000)

Indicates that a method is called 1000 times and is considered a hotspot code and triggers an immediate compilation

How to set virtual machine parameters with MyEclipse

Right-click Class-->run As-->run configurations ...

Java application in the selection of their own class, select ARGUMENTS,VM arguments blank section to set the virtual machine parameters. If clicking on Run configurations does not appear in your class, it's okay to double-click Java application.

Postscript

There are hundreds of Java Virtual machine parameters, a large part of the performance tuning is the choice of the hundreds of parameters in some of the important parameters to set, and according to the operation of the project to continuously adjust the parameters in order to achieve a performance best point. Performance tuning there are shortcuts and shortcuts. Baidu search a recommended JVM parameter settings for others to change, then as to the specific good not to say, but at least to ensure that it can use it; performance tuning said there is no shortcut and no shortcut, if the performance of the JVM has stringent requirements and want to refine to every small point, to achieve the best value, That first must be for the Java Virtual machine, for each virtual machine parameters have a deep understanding of the line. In recent years the rise of a job called performance tuning, also proves the importance of performance optimization, anyway, from a personal point of view, performance tuning is definitely a learning, not so simple, lay the foundation is the king.

Java Virtual Machine Learning 3, Common JVM command parameters

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.