您的位置:首页 > 运维架构

【JVM】JVM性能监控与故障处理工具

2017-08-20 21:49 295 查看
一、概述

给一个系统定位问题的时候,知识、经验是关键基础,数据是依据,工具是运用知识处理数据的手段。这里说的数据包括:运行日志、异常堆栈、GC日志、线程快照(threadDump/javacore文件)、堆转储快照(heapDump/hprof文件)等。介绍JVM性能监控与故障处理工具旨在帮助大家了解如何使用sun公司给我们Java开发者提供的JVM监控工具。

名称主要作用
jpsJVM Process Status Tool,显示指定系统内所有的HotSpot虚拟机进行
jstatJVM Statistics Monitoring Tool,用于手机HotSpot虚拟机各方面的运行数据
jinfoConfiguration Info for Java,显示虚拟机配置信息
C:\Users\moxianbin>jps -v
6932 Launcher -Xmx700m -Djava.awt.headless=true -Djava.endorsed.dirs="" -Djdt.co
mpiler.useSingleThread=true -Dpreload.project.path=C:/Users/moxianbin/git/gatewa
y-test -Dpreload.config.path=C:/Users/moxianbin/.IntelliJIdea2016.2/config/optio
ns -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djava.net.prefe
rIPv4Stack=true -Dio.netty.initialSeedUniquifier=-5953357909903199040 -Dfile.enc
oding=GBK -Djps.file.types.component.name=FileTypeManager -Duser.language=zh -Du
ser.country=CN -Didea.paths.selector=IntelliJIdea2016.2 -Didea.home.path=C:\Prog
ram Files (x86)\JetBrains\IntelliJ IDEA 2016.2.1 -Didea.config.path=C:\Users\mox
ianbin\.IntelliJIdea2016.2\config -Didea.plugins.path=C:\Users\moxianbin\.Intell
iJIdea2016.2\config\plugins -Djps.log.dir=C:/Users/moxianbin/.IntelliJIdea2016.2
/system/log/build-log -Djps.fallback.jdk.home=C:/Program Files (x86)/JetBrains/I
ntelliJ IDEA 2016.2.1/jre/jre -Djps.fallback.jdk.version=1.8.0_76-release -Djava
.io.tmpdir=C:/Users/moxianbin/.IntelliJIdea2016.2/system/compile-server/_temp_
45512 Launcher -Xmx700m -Djava.awt.headless=true -Djava.endorsed.dirs="" -Djdt.c
ompiler.useSingleThread=true -Dpreload.project.path=C:/Users/moxianbin/git/Guava
Study -Dpreload.config.path=C:/Users/moxianbin/.IntelliJIdea2016.2/config/option
s -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djava.net.prefer
IPv4Stack=true -Dio.netty.initialSeedUniquifier=-5953357909903199040 -Dfile.enco
ding=GBK -Didea.maven.embedder.version=3.3.9 -Dfile.encoding=GBK


C:\Users\moxianbin>jinfo -flags 6932
Attaching to process ID 6932, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.66-b18
Non-default VM flags: -XX:CICompilerCount=3 -XX:InitialHeapSize=134217728 -XX:Ma
xHeapSize=734003200 -XX:MaxNewSize=244318208 -XX:MinHeapDeltaBytes=524288 -XX:Ne
wSize=44564480 -XX:OldSize=89653248 -XX:+UseCompressedClassPointers -XX:+UseComp
ressedOops -XX:+UseFastUnorderedTimeStamps -XX:-UseLargePagesIndividualAllocatio
n -XX:+UseParallelGC


名称主要作用
jmapMemory Map For Java,生成虚拟机的内存转储快照OOM异常必备指令(heapdump文件),也可以使用JVM OPTION进行打印 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/Users/moxianbin/Documents/Java/heapdump.hprod
jhatJVM Heap Dump Browser,用于分析heapdump文件,它会建议一个HTTP/HTML服务器,让用户可以在浏览器上查看分析结果
jstackStack Trace For Java,显示虚拟机的线程栈快照
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jvm java 故障 性能