JVM parameter Description

Source: Internet
Author: User

After doing so many years of Java, self-thought is familiar, in fact, is still far away, what also say, or a solid geoscience bar. Today, summarize the startup parameters of the commonly used JVM.

Parameter categories

Parameter items

Description

Standard parameters (--all JVM implementations must implement the functions of these parameters, and are backwards compatible)

-client

Starting the JVM in client mode is fast, but the runtime performance and memory management efficiency is not high, suitable for client programs or development debugging.

-server

Starting the JVM in server mode is the exact opposite of the client. Suitable for production environments. The 64-bit JVM is automatically started in server mode.

-classpath

-cp

Tells the JVM class to search for a path. If-classpath is specified, the JVM ignores the path specified in Classpath. Each path is separated by semicolons. If neither-classpath nor Classpath are specified, the JVM looks for class from the current path.

The JVM searches for class in the same way and in the order: Bootstrap (the JVM comes with)->extension (Jre_home/lib/ext)->user (the application's own). The following statements output path information for the above three ways:

System.getproperty ("Sun.boot.class.path");

System.getproperty ("Java.ext.dirs");

System.getproperty ("Java.class.path");

-dproperty=value

Sets the system property name/value pair. If there are spaces in value, you need to use double quotation marks.

-jar

Specify to start the application as a jar package

-javaagent:<jarpath>[=<options>]

Specifies that the JVM starts fashion into the Java language device proxy. About device agents is the new concept of jdk1.5. Further information can refer to the Java.lang.instrument.Instrumentation interface

-VERBOSE[:CLASS|GC|JNI]

Output separately:

The JVM loads the information for the class. Useful when diagnosing classnotfound errors

JVM information for each GC.

The case of the native method invocation, which is used to diagnose JNI calls.

Non-standard parameters (-X, the default JVM implements this functionality, but does not guarantee that all JVMs are implemented and is not guaranteed backwards compatibility)

-xbootclasspath:bootclasspath

Lets the JVM load Bootclass from the specified path to replace the JDK's rt.jar. Generally not used.

-xbootclasspath/a:path

The specified file is appended to the default bootstrap path.

-xbootclasspath/p:path

Let the JVM take precedence over the default bootstrap to load the class specified in path

-xincgc

The incremental GC is turned on and is not normally used.

-xloggc:file

Output GC logs, which is useful in the absence of professional monitoring tools.

-xmsn

Specifies the initial size of the JVM heap. Default is 1/64 of physical memory

-xmxn

Specifies the maximum value of the JVM heap. Default is 1/4 of physical memory

-xprof

Track running programs and output trace data to standard output for development debugging.

-xssn

Sets the size of a single line stacks.

Non-stable parameters (-XX, the implementations of each JVM are different and may disappear at any time)

-xx:+scavengebeforefullgc

The new generation GC takes precedence over full GC execution

-xx:+usegcoverheadlimit

The percentage of time the JVM consumes on the GC before it throws an oom.

-xx:-useconcmarksweepgc

Using the concurrency Tag Exchange algorithm for GC. Concurrency refers to a thread at the same time GC, suitable for multi-core processor situation, concurrency must meet the parallel, and vice versa.

-xx:-useparallelgc

Enable parallel GC. Parallelism means that the application thread is not interrupted when a separate thread is GC,GC.

-xx:-useserialgc

Enable serial GC. The new version of the JDK won't do that.

-xx:maxnewsize=size

The size of the heap is occupied by the newly generated objects in the Java heap

-xx:maxpermsize=size

The maximum number of older generation-occupied heaps in the Java heap

-xx:headdumppath=./java_pid<pid>.hprof

Specifies the path or file name when the heap information is exported.

-xx:-headdumponoutofmemoryerror

Export the relevant information in this heap when Oom first appears.

-xx:-P RINTGC

Print related information each time the GC

-xx:-P RINTGC Details

Print Details per GC

-xx:-P Rintgctimestamps

Print the timestamp of the GC

-xx:-tranceclassloading

Tracking load information for a class

-xx:-traceclassloadingpreorder

Trace load information for all classes referenced to

-xx:-tranceclassresolution

TRACE Constant Pool

-xx:-traceclassunloading

Tracking uninstall information for a class

Http://www.cnblogs.com/wenfeng762/archive/2011/08/14/2137810.html

JVM parameter Description (GO)

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.