OPTIONS
The jps command supports a number of options that modify the output of
the command. These options are subject to change or removal in the
future.
-q
Suppresses the output of the class name, JAR file name, and
arguments passed to the main method, producing only a list of
local JVM identifiers.
-m
Displays the arguments passed to the main method. The output may
be null for embedded JVMs.
-l
Displays the full package name for the application's main class
or the full path name to the application's JAR file.
-v
Displays the arguments passed to the JVM.
-V
Suppresses the output of the class name, JAR file name, and
arguments passed to the main method, producing only a list of
local JVM identifiers.
-Joption
Passes option to the JVM, where option is one of the options
described on the reference page for the Java application
launcher. For example, -J-Xms48m sets the startup memory to 48
MB. See java(1).
runnable:状态一般为RUNNABLE。
in Object.wait():等待区等待,状态为WAITING或TIMED_WAITING。
waiting for monitor entry:进入区等待,状态为BLOCKED。
waiting on condition:等待区等待、被park。
sleeping:休眠的线程,调用了Thread.sleep()。
看一下命令吧:
➜ ~ jstack
Usage:
jstack [-l]
(to connect to running process)
jstack -F [-m] [-l]
(to connect to a hung process)
jstack [-m] [-l]
(to connect to a core file)
jstack [-m] [-l] [server_id@]
(to connect to a remote debug server)
Options:
-F to force a thread dump. Use when jstack does not respond (process is hung)
-m to print both java and native frames (mixed mode)
-l long listing. Prints additional information about locks
-h or -help to print this help message
OPTIONS
The jstat command supports two types of options, general options and
output options. General options cause the jstat command to display
simple usage and version information. Output options determine the
content and format of the statistical output.
All options and their functionality are subject to change or removal in
future releases.
General Options
If you specify one of the general options, then you cannot specify any
other option or parameter.
-help
Displays a help message.
-options
Displays a list of static options. See Output Options.
Output Options
If you do not specify a general option, then you can specify output
options. Output options determine the content and format of the jstat
command's output, and consist of a single statOption, plus any of the
other output options (-h, -t, and -J). The statOption must come first.
Output is formatted as a table, with columns that are separated by
spaces. A header row with titles describes the columns. Use the -h
option to set the frequency at which the header is displayed. Column
header names are consistent among the different options. In general, if
two options provide a column with the same name, then the data source
for the two columns is the same.
Use the -t option to display a time stamp column, labeled Timestamp as
the first column of output. The Timestamp column contains the elapsed
time, in seconds, since the target JVM started. The resolution of the
time stamp is dependent on various factors and is subject to variation
due to delayed thread scheduling on heavily loaded systems.
Use the interval and count parameters to determine how frequently and
how many times, respectively, the jstat command displays its output.
Note: Do not to write scripts to parse the jstat command's output
because the format might change in future releases. If you write
scripts that parse jstat command output, then expect to modify them for
future releases of this tool.
-statOption
Determines the statistics information the jstat command displays.
The following lists the available options. Use the -options general
option to display the list of options for a particular platform
installation. See Stat Options and Output.
class: Displays statistics about the behavior of the class loader.
compiler: Displays statistics about the behavior of the Java
HotSpot VM Just-in-Time compiler.
gc: Displays statistics about the behavior of the garbage collected
heap.
gccapacity: Displays statistics about the capacities of the
generations and their corresponding spaces.
gccause: Displays a summary about garbage collection statistics
(same as -gcutil), with the cause of the last and current (when
applicable) garbage collection events.
gcnew: Displays statistics of the behavior of the new generation.
gcnewcapacity: Displays statistics about the sizes of the new
generations and its corresponding spaces.
gcold: Displays statistics about the behavior of the old generation
and metaspace statistics.
gcoldcapacity: Displays statistics about the sizes of the old
generation.
gcmetacapacity: Displays statistics about the sizes of the
metaspace.
gcutil: Displays a summary about garbage collection statistics.
printcompilation: Displays Java HotSpot VM compilation method
statistics.
-h n
Displays a column header every n samples (output rows), where n is
a positive integer. Default value is 0, which displays the column
header the first row of data.
-t
Displays a timestamp column as the first column of output. The time
stamp is the time since the start time of the target JVM.
-JjavaOption
Passes javaOption to the Java application launcher. For example,
-J-Xms48m sets the startup memory to 48 MB. For a complete list of
options, see java(1).
Stat Options and Output
The following information summarizes the columns that the jstat command
outputs for each statOption.
-class option
Class loader statistics.
Loaded: Number of classes loaded.
Bytes: Number of kBs loaded.
Unloaded: Number of classes unloaded.
Bytes: Number of Kbytes unloaded.
Time: Time spent performing class loading and unloading operations.
-compiler option
Java HotSpot VM Just-in-Time compiler statistics.
Compiled: Number of compilation tasks performed.
Failed: Number of compilations tasks failed.
Invalid: Number of compilation tasks that were invalidated.
Time: Time spent performing compilation tasks.
FailedType: Compile type of the last failed compilation.
FailedMethod: Class name and method of the last failed compilation.
-gc option
Garbage-collected heap statistics.
S0C: Current survivor space 0 capacity (kB).
S1C: Current survivor space 1 capacity (kB).
S0U: Survivor space 0 utilization (kB).
S1U: Survivor space 1 utilization (kB).
EC: Current eden space capacity (kB).
EU: Eden space utilization (kB).
OC: Current old space capacity (kB).
OU: Old space utilization (kB).
MC: Metaspace capacity (kB).
MU: Metacspace utilization (kB).
CCSC: Compressed class space capacity (kB).
CCSU: Compressed class space used (kB).
YGC: Number of young generation garbage collection events.
YGCT: Young generation garbage collection time.
FGC: Number of full GC events.
FGCT: Full garbage collection time.
GCT: Total garbage collection time.
-gccapacity option
Memory pool generation and space capacities.
NGCMN: Minimum new generation capacity (kB).
NGCMX: Maximum new generation capacity (kB).
NGC: Current new generation capacity (kB).
S0C: Current survivor space 0 capacity (kB).
S1C: Current survivor space 1 capacity (kB).
EC: Current eden space capacity (kB).
OGCMN: Minimum old generation capacity (kB).
OGCMX: Maximum old generation capacity (kB).
OGC: Current old generation capacity (kB).
OC: Current old space capacity (kB).
MCMN: Minimum metaspace capacity (kB).
MCMX: Maximum metaspace capacity (kB).
MC: Metaspace capacity (kB).
CCSMN: Compressed class space minimum capacity (kB).
CCSMX: Compressed class space maximum capacity (kB).
CCSC: Compressed class space capacity (kB).
YGC: Number of young generation GC events.
FGC: Number of full GC events.
-gccause option
This option displays the same summary of garbage collection
statistics as the -gcutil option, but includes the causes of the
last garbage collection event and (when applicable) the current
garbage collection event. In addition to the columns listed for
-gcutil, this option adds the following columns.
LGCC: Cause of last garbage collection
GCC: Cause of current garbage collection
-gcnew option
New generation statistics.
S0C: Current survivor space 0 capacity (kB).
S1C: Current survivor space 1 capacity (kB).
S0U: Survivor space 0 utilization (kB).
S1U: Survivor space 1 utilization (kB).
TT: Tenuring threshold.
MTT: Maximum tenuring threshold.
DSS: Desired survivor size (kB).
EC: Current eden space capacity (kB).
EU: Eden space utilization (kB).
YGC: Number of young generation GC events.
YGCT: Young generation garbage collection time.
-gcnewcapacity option
New generation space size statistics.
NGCMN: Minimum new generation capacity (kB).
NGCMX: Maximum new generation capacity (kB).
NGC: Current new generation capacity (kB).
S0CMX: Maximum survivor space 0 capacity (kB).
S0C: Current survivor space 0 capacity (kB).
S1CMX: Maximum survivor space 1 capacity (kB).
S1C: Current survivor space 1 capacity (kB).
ECMX: Maximum eden space capacity (kB).
EC: Current eden space capacity (kB).
YGC: Number of young generation GC events.
FGC: Number of full GC events.
-gcold option
Old generation and metaspace behavior statistics.
MC: Metaspace capacity (kB).
MU: Metaspace utilization (kB).
CCSC: Compressed class space capacity (kB).
CCSU: Compressed class space used (kB).
OC: Current old space capacity (kB).
OU: Old space utilization (kB).
YGC: Number of young generation GC events.
FGC: Number of full GC events.
FGCT: Full garbage collection time.
GCT: Total garbage collection time.
-gcoldcapacity option
Old generation size statistics.
OGCMN: Minimum old generation capacity (kB).
OGCMX: Maximum old generation capacity (kB).
OGC: Current old generation capacity (kB).
OC: Current old space capacity (kB).
YGC: Number of young generation GC events.
FGC: Number of full GC events.
FGCT: Full garbage collection time.
GCT: Total garbage collection time.
-gcmetacapacity option
Metaspace size statistics.
MCMN: Minimum metaspace capacity (kB).
MCMX: Maximum metaspace capacity (kB).
MC: Metaspace capacity (kB).
CCSMN: Compressed class space minimum capacity (kB).
CCSMX: Compressed class space maximum capacity (kB).
YGC: Number of young generation GC events.
FGC: Number of full GC events.
FGCT: Full garbage collection time.
GCT: Total garbage collection time.
-gcutil option
Summary of garbage collection statistics.
S0: Survivor space 0 utilization as a percentage of the space's
current capacity.
S1: Survivor space 1 utilization as a percentage of the space's
current capacity.
E: Eden space utilization as a percentage of the space's current
capacity.
O: Old space utilization as a percentage of the space's current
capacity.
M: Metaspace utilization as a percentage of the space's current
capacity.
CCS: Compressed class space utilization as a percentage.
YGC: Number of young generation GC events.
YGCT: Young generation garbage collection time.
FGC: Number of full GC events.
FGCT: Full garbage collection time.
GCT: Total garbage collection time.
-printcompilation option
Java HotSpot VM compiler method statistics.
Compiled: Number of compilation tasks performed by the most
recently compiled method.
Size: Number of bytes of byte code of the most recently compiled
method.
Type: Compilation type of the most recently compiled method.
Method: Class name and method name identifying the most recently
compiled method. Class name uses slash (/) instead of dot (.) as a
name space separator. Method name is the method within the
specified class. The format for these two fields is consistent with
the HotSpot -XX:+PrintCompilation option.
outOfMemoryError 年老代内存不足。
outOfMemoryError:PermGen Space 永久代内存不足。
outOfMemoryError:GC overhead limit exceed 垃圾回收时间占用系统运行时间的98%或以上。
用法摘要
➜ ~ jmap
Usage:
jmap [option]
(to connect to running process)
jmap [option]
(to connect to a core file)
jmap [option] [server_id@]
(to connect to remote debug server)
where
is one of:
to print same info as Solaris pmap
-heap to print java heap summary
-histo[:live] to print histogram of java object heap; if the "live"
suboption is specified, only count live objects
-clstats to print class loader statistics
-finalizerinfo to print information on objects awaiting finalization
-dump: to dump java heap in hprof binary format
dump-options:
live dump only live objects; if not specified,
all objects in the heap are dumped.
format=b binary format
file= dump heap to
Example: jmap -dump:live,format=b,file=heap.bin
-F force. Use with -dump: or -histo
to force a heap dump or histogram when does not
respond. The "live" suboption is not supported
in this mode.
-h | -help to print this help message
-J to pass directly to the runtime system
➜ ~ jhat -help
Usage: jhat [-stack ] [-refs ] [-port ] [-baseline ] [-debug ] [-version] [-h|-help]
-J Pass directly to the runtime system. For
example, -J-mx512m to use a maximum heap size of 512MB
-stack false: Turn off tracking object allocation call stack.
-refs false: Turn off tracking of references to objects
-port : Set the port for the HTTP server. Defaults to 7000
-exclude : Specify a file that lists data members that should
be excluded from the reachableFrom query.
-baseline : Specify a baseline object dump. Objects in
both heap dumps with the same ID and same class will
be marked as not being "new".
-debug : Set debug level.
0: No debug output
1: Debug hprof file parsing
2: Debug hprof file parsing, no server
-version Report version number
-h|-help Print this help and exit
The file to read
For a dump file that contains multiple heap dumps,
you may specify which dump in the file
by appending "#" to the file name, i.e. "foo.hprof#3".
All boolean options default to "true"
说明:
-stack false|true
关闭对象分配调用栈跟踪(tracking object allocation call stack)。 如果分配位置信息在堆转储中不可用. 则必须将此标志设置为 false. 默认值为 true.
-refs false|true
关闭对象引用跟踪(tracking of references to objects)。 默认值为 true. 默认情况下, 返回的指针是指向其他特定对象的对象,如反向链接或输入引用(referrers or incoming references), 会统计/计算堆中的所有对象。
-port port-number
设置 jhat HTTP server 的端口号. 默认值 7000.
-exclude exclude-file
指定对象查询时需要排除的数据成员列表文件(a file that lists data members that should be excluded from the reachable objects query)。 例如, 如果文件列列出了 java.lang.String.value , 那么当从某个特定对象 Object o 计算可达的对象列表时, 引用路径涉及 java.lang.String.value 的都会被排除。
-baseline exclude-file
指定一个基准堆转储(baseline heap dump)。 在两个 heap dumps 中有相同 object ID 的对象会被标记为不是新的(marked as not being new). 其他对象被标记为新的(new). 在比较两个不同的堆转储时很有用.
-debug int
设置 debug 级别. 0 表示不输出调试信息。 值越大则表示输出更详细的 debug 信息.
-version
启动后只显示版本信息就退出
-J< flag >
因为 jhat 命令实际上会启动一个JVM来执行, 通过 -J 可以在启动JVM时传入一些启动参数. 例如, -J-Xmx512m 则指定运行 jhat 的Java虚拟机使用的最大堆内存为 512 MB. 如果需要使用多个JVM启动参数,则传入多个 -Jxxxxxx.
在使用Eclipse进行开发的时候,出现了如下的问题:
Description Resource Path Location TypeThe project was not built due to "A resource exists with a different case: '/SeenTaoImp_zhV2/bin/seentao'.&
var grid = $('#datagrid');
var options = grid.datagrid('getPager').data("pagination").options;
var curr = options.pageNumber;
var total = options.total;
var max =