(Turn) Java Virtual Machine (JVM) parameters configuration instructions

Java Virtual Machine (JVM) parameters configuration instructions

In Java, J2EE large-scale applications, JVM configuration of non-standard parameter is directly related to the overall system performance.
Non-standard JVM is a JVM parameter refers to the bottom of some of the configuration parameters, these parameters can be in the general development of the default, does not require any configuration. However, in a production environment, in order to improve performance, often need to adjust these parameters, in order to achieve the best new system can be.
In addition the configuration of these parameters affect the system stability is also an important factor, I believe the majority of Java developers have all seen the "OutOfMemory" type of error. Oh, it is very possible for them to configure JVM parameters are not configured properly or simply did not realize that configuration.

To illustrate these parameters also need to talk about the JDK in the command-line tools pave the way for some knowledge.

First, look at how to obtain these commands configuration information Note:
Suppose you are a windows platform, you have installed the J2SDK, so now you from the cmd console window into the J2SDK installation directory under the bin directory, and then run the java command, appear the following results, these are the tools and JVM, including java.exe all the commands are inside.

-------------------------------------------------- ---------------------
D: \ j2sdk15 \ bin> java
Usage: java [-options] class [args ...]
(to execute a class)
or java [-options]-jar jarfile [args ...]
(to execute a jar file)

where options include:
-client to select the "client" VM
-server to select the "server" VM
-hotspot is a synonym for the "client" VM [deprecated]
The default VM is client.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D <name> = <value>
set a system property
-verbose [: class | gc | jni]
enable verbose output
-version print product version and exit
-version: <value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search |-jre-no-restrict-search
include / exclude user private JREs in the version search
-?-Help print this help message
-X print help on non-standard options
-ea [: <packagename> ...|:< classname>]
-enableassertions [: <packagename> ...|:< classname>]
enable assertions
-da [: <packagename> ...|:< classname>]
-disableassertions [: <packagename> ...|:< classname>]
disable assertions
-esa |-enablesystemassertions
enable system assertions
-dsa |-disablesystemassertions
disable system assertions
-agentlib: <libname> [= <options>]
load native agent library <libname>, eg-agentlib: hprof
see also,-agentlib: jdwp = help and-agentlib: hprof = help
-agentpath: <pathname> [= <options>]
load native agent library by full pathname
-javaagent: <jarpath> [= <options>]
load Java programming language agent, see java.lang.instrument
-------------------------------------------------- ---------------------
In the console output, there is one-X (note the uppercase) command, this is the view the JVM configuration parameters command.

Next, use the java-X command to view the configuration of JVM instructions:
Running the following results, which is to configure JVM parameters, secret weapon, this information is in English, in order to facilitate the reading, I understand according to their own translated into Chinese and the (inaccuracies, were invited to Friends of Fu Zheng Bo)
-------------------------------------------------- ---------------------
D: \ j2sdk15 \ bin> java-X
-Xmixed mixed mode execution (default)
-Xint interpreted mode execution only
-Xbootclasspath: <directories and zip/jar files separated by ;>
set search path for bootstrap classes and resources
-Xbootclasspath / a: <directories and zip/jar files separated by ;>
append to end of bootstrap class path
-Xbootclasspath / p: <directories and zip/jar files separated by ;>
prepend in front of bootstrap class path
-Xnoclassgc disable class garbage collection
-Xincgc enable incremental garbage collection
-Xloggc: <file> log GC status to a file with time stamps
-Xbatch disable background compilation
-Xms <size> set initial Java heap size
-Xmx <size> set maximum Java heap size
-Xss <size> set java thread stack size
-Xprof output cpu profiling data
-Xfuture enable strictest checks, anticipating future default
-Xrs reduce use of OS signals by Java / VM (see documentation)
-Xcheck: jni perform additional checks for JNI functions
-Xshare: off do not attempt to use shared class data
-Xshare: auto use shared class data if possible (default)
-Xshare: on require using shared class data, otherwise fail.

The-X options are non-standard and subject to change without notice.
-------------------------------------------------- ---------------------

JVM configuration parameters in Chinese Description:
-------------------------------------------------- ---------------------
1,-Xmixed mixed mode execution (default)
Mixed-mode implementation of

2,-Xint interpreted mode execution only
Explain the mode

3,-Xbootclasspath: <directories and zip/jar files separated by ;>
set search path for bootstrap classes and resources
Set zip / jar resources or class (. Class files) stored directory path

3,-Xbootclasspath / a: <directories and zip/jar files separated by ;>
append to end of bootstrap class path
Additional zip / jar resources or class (. Class files) stored directory path

4,-Xbootclasspath / p: <directories and zip/jar files separated by ;>
prepend in front of bootstrap class path
Pre-loaded zip / jar resources or class (. Class files) stored directory path

5,-Xnoclassgc disable class garbage collection
Close Class garbage collection

6,-Xincgc enable incremental garbage collection
Open the class garbage collection function

7,-Xloggc: <file> log GC status to a file with time stamps
Records of garbage back to the log to a file.

8,-Xbatch disable background compilation
Turn off background compilation

9,-Xms <size> set initial Java heap size
Set JVM heap memory size initialization

10,-Xmx <size> set maximum Java heap size
Set the JVM maximum heap memory size of

11,-Xss <size> set java thread stack size
Set JVM memory size of the stack

12,-Xprof output cpu profiling data
Enter CPU summary table data

13,-Xfuture enable strictest checks, anticipating future default
Implementation of a strict code checks to predict possible scenarios

14,-Xrs reduce use of OS signals by Java / VM (see documentation)
To restore the operating system through the JVM Signal

15,-Xcheck: jni perform additional checks for JNI functions
Checks are performed on the JNI function

16,-Xshare: off do not attempt to use shared class data
As much as possible not to use a shared class data

17,-Xshare: auto use shared class data if possible (default)
As much as possible using shared class data

18,-Xshare: on require using shared class data, otherwise fail.
As much as possible using shared class data, otherwise fail to run

The-X options are non-standard and subject to change without notice.
-------------------------------------------------- ---------------------

This is how to use these parameters do? Actually, all the command line are such a use, the following I will give a simple example to demonstrate the HelloWorl usage of this parameter is very simple.

HelloWorld.java
-----------------------------------------------
public class HelloWorld
(
public static void main (String [] args)
(
System.out.println ( "Hello World!");
)
)

Compile and run:
D: \ j2sdk15 \ bin> javac HelloWorld.java

D: \ j2sdk15 \ bin> java-Xms256M-Xmx512M HelloWorld
Hello World!

Oh, that met under the bar!

Practice: In the large-scale systems or applications to configure JVM parameters to configure your IDE tools such as the parameters are common IDEA, Eclipse, this is specified in a configuration file can be.
If you want to configure the J2EE environment, these parameters, then you need to J2EE application server or Servlet container-related startup parameters at specified, the startup file to configure, Tomcat is catalina.bat configure, weblogic and websphere is in other place, specifically I said, and I believe played these large servers know that not played read this article, play will know, He He.

In addition to the jdk is often asked some of the relevant commands usage, in fact, when you see here, you should know how to get the usage of these commands. If you do not, then I suggest you go to learn DOS, I was a Meizhe. If you will these still did not look to understand, then you quickly learn English bar, so you can read the.

Also: I Finally, several commonly used Java command-line instructions for reference:

(1), javac
Usage: javac <Options "" source files "
Among them, possible options include:
-g generate all debugging information
-g: none does not generate any debugging information
-g: (lines, vars, source) Generate only some debugging information
-nowarn does not generate any warning
-verbose output of the compiler is running the news operation
-deprecation Output using the outdated API, the source location
-classpath <path to "specify the location of the file to find user class
-cp <path to "specify the location of the file to find user class
-sourcepath <Path "specifies the location to find input source files
-bootclasspath <path to "override the location of bootstrap class files
-extdirs <Directory "covers the location of installed extensions directory
-endorseddirs <Directory "the path covered by the location of the standard signature
-d <directory "specify the storage location of the generated class files
-encoding <encoding "specifies the character encoding used by source files
-source <Version "to provide compatibility with the specified version of the source
-target <version of the "build a specific VM version of the class file
-version version information
-help Output a synopsis of standard options
Output of non-standard options-X Summary
-J <flag "directly to" mark "passed to the run-time system

(2), jar
Usage: jar (ctxu) [vfm0Mi] [jar-file] [manifest-file] [-C directory] file name ...
Options:
-c create new archive
-t List archive contents list
-x expand archive named (or all of the files]
-u update existing archive
-v generate verbose output to standard output
-f specify archive file name
-m mark the file that contains information from the identified
-0 Only the storage mode; not use ZIP compression format
-M does not produce a list of all items (manifest] file
-i for the specified jar file index information generated
-C change to the specified directory, and contains the following files:
If a file name is a directory, it will be recursive processing.
List (manifest] file names and archive file names need to be specified, according to 'm' and 'f' flag specified in the same order.

Example 1: The two class files into an archive called 'classes.jar' archive file:
jar cvf classes.jar Foo.class Bar.class
Example 2: Use an existing list (manifest) file 'mymanifest' the foo / directory of all
File archive into a directory called 'classes.jar' archive file:
jar cvfm classes.jar mymanifest-C foo /.

(3), javadoc
javadoc: error - do not specify a package or class.
Usage: javadoc [options] [package name] [source file] [@ file]
-overview <file "to read an overview of the document HTML document
-public Show only public classes and members
-protected Show protected / public classes and members (default)
-package Show package / protected / public classes and members
-private Show all classes and members of the
-help Displays the command-line options and exit
-doclet <class "output is generated through alternative doclet
-docletpath <Path "specifies the location to find doclet class files
-sourcepath <path list "to find the source file location of the designated
-classpath <path list "to find the user specify the location of class files
-exclude <package list "to specify a list of packages to exclude
-subpackages <sub-packages list "to specify recursively into sub-packages
BreakIterator calculate the first-breakiterator using a
-bootclasspath <path list "covered by the bootstrap class loader loaded the
The location of class files
-source <Version "to provide compatibility with the specified version of the source
-extdirs <directory listing "covers the location of installed extensions directory
-verbose output of the Javadoc news operation is being performed
-locale <name "to use the language environment, such as en_US or en_US_WIN
-encoding <name of the "source file encoding name of the
-quiet do not display status messages
-J <flag "directly to" mark "passed to the run-time system

Through the standard doclet provides:
-d <directory "output file destination directory
-use Create class and package usage pages
-version contains the @ version paragraphs
@ author paragraphs-author with
-docfilessubdirs recursive copy the document file subdirectory
-splitindex the index into each letter corresponds to a file
-windowtitle <text "of the document title of the browser window
-doctitle <html Code > contains an overview of the title of the page
-header <html Code > the header of each page contains the text of
-footer <html Code > footer of each page contains the text of
-bottom <html Code > the bottom of each page contains the text
-link <url> create a link to the javadoc output in the <url> links
-linkoffline <url> <url2> the use of software packages in the list of links to <url2> in <url>
Documents
-excludedocfilessubdir <Name 1 ": .. ruled out with the given name of the subdirectories of all document files.
-group <name> <p1>: <p2> .. in the overview page, the specified package group
-nocomment curb descriptions and tags, generate only declarations.
-nodeprecated does not contain @ deprecated information
-noqualifier <Name one ":" Name two >:... excluded from the output list of qualifiers.
-nosince does not include @ since information
-notimestamp does not contain a hidden timestamp
-nodeprecatedlist does not generate a list of obsolete
-notree does not generate class hierarchy
-noindex does not generate an index
-nohelp not generate help link
-nonavbar not generate navigation bar
-serialwarn generates a warning about @ serial tag
-tag <name ":" location ":" title "custom tag specifies a single variable
-taglet to register the fully qualified name of the Taglet
The path-tagletpath Taglet
-charset <character set "for cross-platform view the generated document character set.
-helpfile <file "contains information to help link the links to the file
-linksource in HTML format generated source
-sourcetab <tab length "specifies the source of each space occupied by the number of tabs
-keywords so that package, class and member information with HTML meta tags
-stylesheetfile <path "is used to change the style of the paper document generated
-docencoding <name of the "name of the output coding

(4), rmid
rmid: Illegal option: -?
Usage: rmid <option>

Which, <option> including:
-port <option> designated for the use of the port rmid
-log <directory> specify the directory to write log rmid
-stop stop the current rmid call (on the specified port)
-C <runtime Mark > to pass parameters to each child process (activation group)
-J <runtime Mark > to pass parameters to the java interpreter

There are a lot of work, and on holiday, HOHO, 51 came to write after the bar!

分类:Java 时间:2008-12-30 人气:784
分享到:
blog comments powered by Disqus

相关文章

  • JAVA virtual machine works (turn) 2011-09-01

    JAVA virtual machine works 2009-04-11 21:41:25 | Category: JAVA programming accumulation | Tags: | font size medium and small subscription Java Virtual Machine in between machines and compiler, on any platform are provided to the compiler a common in

  • Solution (myeclipse) could not create the java virtual machine problem 2010-03-24

    Solution could not create the java virtual machine problem can not open the myeclipse, Baocuo "could not create the java virtual machine", the settlement process is as follows: 1, in E: \ MyEclipse6.0 \ eclipse have eclipse.ini documents, the or

  • Java Virtual Machine (JVM) parameters configuration instructions (turn) 2010-03-29

    Java Virtual Machine (JVM) parameters configuration instructions In Java, J2EE large-scale applications, JVM configuration of non-standard parameter is directly related to the overall system performance. Non-standard JVM is a JVM parameter refers to

  • JVM (java virtual machine), tuning, GC (garbage collection) 2009-09-04

    Keywords: JVM (java virtual machine), tuning, GC (garbage collection) JVM GC tuning the JVM GC in order to be able to tune to use in a specific practice, the following will use several examples to illustrate the GC-tuning. Example 1: Heap size settin

  • Java Virtual Machine (JVM) parameters configuration instructions 2010-09-04

    In Java, J2EE large applications, JVM non-standard configuration parameters directly related to the overall system performance. Non-standard JVM JVM parameter refers to the bottom of some configuration parameters that can be in the general developmen

  • [Change] Java Virtual Machine (JVM) parameters configuration instructions 2010-09-16

    Java Virtual Machine (JVM) parameters configuration instructions In Java, J2EE large applications, JVM non-standard configuration parameters directly related to the overall system performance. Non-standard JVM JVM parameter refers to the bottom of so

  • Java Virtual Machine (JVM) configuration parameters that 2010-11-11

    Switch to "Java Virtual Machine (JVM) configuration parameters that" a text ( http://lavasoft.blog.51cto.com/62575/25492 ) Copyright: For reprint, please contact the original author. Otherwise held liable. Java Virtual Machine (JVM) configuratio

  • Java virtual machine instructions of several command-line arguments 2010-03-29

    1, run class file Implementation of the class file with a main method, Java virtual machine command parameter Behavior: java <CLASS File name > NOTE: CLASS file names do not bring the file suffix. class For example: java Test If the class file is ex

  • Java virtual machine class loader order 2010-04-15

    When the JVM (Java Virtual Machine) starts, it will result in the composition of the three initial class loader class loader hierarchy: bootstrap classloader | extension classloader | system classloader bootstrap classloader - boot (also known as the

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 1.103 (s). 12 q(s)