Java startup parameter Three: non-stable parameters

Source: Internet
Author: User

We mentioned earlier that the list of parameters prefixed with-XX may not be robust in the JVM, Sun is not recommended, and may be canceled without notice, but because many of these parameters are useful to us, such as the-xx:permsize that we often see, Xx:maxpermsize and so on;

Below we will describe the list of configurable parameters for-XX: In the Java HotSpot VM;
These parameters can be loosely aggregated into three categories:
Behavioral parameters (behavioral Options): Used to change some of the underlying behavior of the JVM;
Performance tuning (Performance Tuning): Optimized for JVM performance;
Debug parameters (Debugging Options): Typically used to open trace, print, output, and other JVM parameters, to display the JVM more detailed information;

Since there are very few descriptions of the parameters in the Sun's official documentation (mostly only a single word), and most of the OS-level stuff is difficult to describe, here are some of the more configurable items that we might use in our development, and if you need to see all the parameter lists, click the Hotspot VM Specific Options. View original text;

First, let's introduce the behavior parameters:

Parameters and their default value descriptions
-XX:-DISABLEEXPLICITGC prohibit calling System.GC (), but the JVM's GC is still valid
-xx:+maxfdlimit limit of maximum file descriptors
-XX:+SCAVENGEBEFOREFULLGC Generation GC takes precedence over full GC execution
-xx:+usegcoverheadlimit limits the amount of time the JVM spends on GC before throwing an Oom
-XX:-USECONCMARKSWEEPGC for GC using concurrent tag switching algorithm for Laosheng generation
-XX:-USEPARALLELGC enabling parallel GC
-XX:-USEPARALLELOLDGC enables parallelism on full GC, which is automatically enabled when-XX:-USEPARALLELGC is enabled
-XX:-USESERIALGC Enable serial GC
-xx:+usethreadpriorities Enable local thread priority

The three parameters of the blackbody in the table above represent three ways that the GC executes in the JVM, namely serial, parallel, concurrency;
Serial (SERIALGC) is the default GC mode of the JVM, which is generally suitable for small applications and single processors, the algorithm is simple and the GC is more efficient, but it may bring pause to the application.
Parallel (PARALLELGC) refers to the GC runtime, no impact on the application run, GC and app both threads are executing concurrently, so as to minimize the impact of the app operation;
Concurrency (CONCMARKSWEEPGC) is a multi-thread concurrent execution GC, generally applicable to multiprocessor systems, can improve the efficiency of GC, but the algorithm is complex, the system consumes large;

Performance Tuning parameter list:

Parameters and their default value descriptions
-xx:largepagesizeinbytes=4m setting a large page size for the Java heap
Maximum percentage of idle in Java heap after-xx:maxheapfreeratio=70 GC
-xx:maxnewsize=size the maximum amount of memory that a new generated object can occupy
-xx:maxpermsize=64m the maximum amount of memory that a Laosheng object can occupy
Minimum percentage of idle amount in Java heap after-xx:minheapfreeratio=40 GC
-xx:newratio=2 the ratio of cenozoic memory capacity to Laosheng memory capacity
-xx:newsize=2.125m the default value of memory used when generating new generation objects
-XX:RESERVEDCODECACHESIZE=32M Reserve the amount of memory the code occupies
-XX:THREADSTACKSIZE=512 set the thread stack size, using the system default value if 0
-xx:+uselargepages using large page memory
In the daily performance tuning we will basically use the above properties of the blackbody;

Debug parameter list:

Parameters and their default value descriptions
-xx:-citime print consumption at JIT compile time
-xx:errorfile=./hs_err_pid

When there is a problem with the system, you cannot use an external tracking tool (such as Jprofiler ...). ), the above parameters will play a significant role, such as dump heap information, print concurrency lock ...

Java startup parameter Three: non-stable 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.