Java Memory Tuning Common commands

Source: Internet
Author: User

1. JPS lists the running Java Process Information command format: JPS [-QMLV]-Q: Specifies that only the output process id;-m: Outputs the parameters passed to the Java process;-L: The full path of the output main function;-V: Displays the parameters passed to the JVM;
2.jstat Tool for observing runtime information for Java applications, which can be used to view the details of the heap Information command format: Jstat-<option> [-t] [-h<lines>] <vmid> [< interval> [<count>]]option can consist of the following values:-class: Display classloader information;-compiler: Displays information about JIT compilation;-GC: Displays heap information related to GC ;-gccapacity: Displays the capacity and usage of each generation;-gccause: Displays garbage collection related information,-gcutil, and shows the cause of the last or current garbage collection;-gcnew: Show New Generation information ;-gcnewcapacity: Show the Cenozoic size and usage;-gcpermcapacity: Show the permanent generation size;-gcold: Show the old age size;-gcoldcapacity: Show the old age size;-gcutil: Displays information about garbage collection ;-printcompilation: Output JIT cheap method information.
The-t parameter can add a timestamp column to the output information to show the program's Run time. -H is used to periodically output header information, and the header can be output once per number of rows through the lines setting. The interval parameter is used to specify the period of the output statistic in milliseconds. COUNT specifies how many times the data is output altogether.
such as: Jstat-class-t 2972 2jstat-compiler ot 2972jstat-gc 2972jstat-gccapacity 2972jstat-gccause 2972
3. Jinfo is used to view the extended parameters of a running Java application, and even supports modifying part of the parameter command format at run time: Jinfo <option> <pid>option:-flag<name> : Prints the specified JVM parameter values;-flag [+|-]<name>: Sets the Boolean value for the specified JVM parameter;-flag<name>=<value>: Sets the value of the specified JVM parameter;
Example: Jinfo-flag maxtenuringthreshold 2972jinfo-flag printgcdetails 2972 Modify Parameters: Jinfo-flag +printgcdetails 2972
4.jmap generates statistics about heap snapshots and objects for Java applications. Jmap-histo 2972 >c:\test.txt//File output heap snapshot jmap-dump:format=b,file=c:\heap.hprof 2972//After a heap of snapshots can be obtained through profiling tools such as Jhat, V isual VM) Analysis

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Java Memory Tuning Common commands

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.