C:\Users\hylexus>jstat -gcutil 670085s 3
S0 S1 EO M CCS YGC YGCT FGC FGCT GCT
0.0083.420.3848.2489.7978.31310.57851.0671.6450.0083.420.3848.2489.7978.31310.57851.0671.6450.0083.420.3848.2489.7978.31310.57851.0671.645
说明:
S0: Survivor0(新生代Survivor)是空的
S1: Survivor1(新生代Survivor)是空的
E: Eden(新生代Eden)占用0.38%
O: Old(老年代)占用48.24%
M:
CCS:
YGC: Young GC==> Minor GC ==> 新生代GC的次数
YGCT: YGC 耗时0.578秒
FGC: Full GC==>老年代GC的次数
FGCT: FGC总耗时1.067秒
GCT: 所有GC总耗时1.645秒
2.3 jinfo
jinfo可以查看和调整虚拟机各项参数。
语法
C:\Users\hylexus>jinfo -help
Usage:
jinfo [option]
(to connect to running process)
jinfo [option]
(to connect to a core file)
jinfo [option] [server_id@]or hostname>
(to connect to remote debug server)
where <option> is one of:
-flag 打印指定参数值
-flag [+|-] 启用(+)或禁用(-)指定参数
-flag = 设置指定参数的值
-flags 打印JVM参数
-sysprops 相当于System.getProperites()
option> 表示不带任何选项,将打印出以上所提到的所有属性
示例
打印出pid为67008的进程的JVM参数
C:\Users\hylexus>jinfo -flags67008
Attaching to process ID 67008, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.101-b13
Non-default VM flags: -XX:-BytecodeVerificationLocal-XX:-BytecodeVerificationRemote-XX:CICompilerCount=3-XX:InitialHeapSize=41943040-XX:MaxHeapSize=1258291200-XX:MaxNewSize=419430400-XX:MinHeapDeltaBytes=524288-XX:NewSize=13631488-XX:OldSize=28311552-XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseFastUnorderedTimeStamps -XX:-UseLargePagesIndividualAllocation-XX:+UseParallelGC
Command line: -Dosgi.requiredJavaVersion=1.8-Xms40m-Xverify:none-Dorg.eclipse.swt.browser.IEVersion=10001-Xmx1200m
生成快照
C:\Users\hylexus>jmap -dump:live,format=b,file=t.bin 67008
Dumping heap to C:\Users\hylexus\t.bin ...
Heap dump file created
C:\Users\hylexus>
# 分析快照
C:\Users\hylexus>jhat t.bin
Reading from t.bin...
Dump file created Mon Dec 1922:43:48 CST 2016
Snapshot read, resolving...
Resolving 1861041 objects...
Chasing references, expect 372 dots....................................................................................................................................................................................................................................................................................................................................................................................
Eliminating duplicate references....................................................................................................................................................................................................................................................................................................................................................................................
Snapshot resolved.
Started HTTP server on port 7000
Server is ready.
此时在浏览器里访问 127.0.0.1:7000就能看到分析结果:
2.6 jstack
jstack(Stack Trace for Java)可以生成虚拟机当前时刻的线程快照。 一般称为threaddump或者javacore文件。即每一条线程正在执行的方法堆栈的集合。
CMS概述
并发标记清理垃圾回收(Concurrent Mark and Sweep GC)算法的主要目标是在GC过程中,减少暂停用户线程的次数以及在不得不暂停用户线程的请夸功能,尽可能短的暂停用户线程的时间。这对于交互式应用,比如web应用来说,是非常重要的。
CMS垃圾回收针对新生代和老年代采用不同的策略。相比同吞吐量垃圾回收,它要复杂的多。吞吐量垃圾回收在执
1,找到配置文件
vi /etc/sysconfig/iptables
2,添加端口开放,增加一行,开放18081端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 18081 -j ACCEPT
3,保存
ESC
:wq!
4,重启服务
service iptables
使用Android SDK Manager 更新了Anadroid SDK Tooks 之后,
打开eclipse提示 This Android SDK requires Android Developer Toolkit version 23.0.0 or above, 点击Check for Updates
检测一会后提示 No update were found