如何查看正在运行的Spark进程的JVM配置以及分代的内存使用情况,是线上运行作业常用的监控手段:
1、通过ps命令查询PID
ps -ef | grep 5661
可以根据命令中的特殊字符来定位pid
2、使用jinfo命令查询该进程的JVM参数设置
jinfo 105007
可以得到详细的JVM配置信息
Attaching to process ID 105007, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.65-b04
Java System Properties:
spark.local.dir = /diskb/sparktmp,/diskc/sparktmp,/diskd/sparktmp,/diske/sparktmp,/diskf/sparktmp,/diskg/sparktmp
java.runtime.name = Java(TM) SE Runtime Environment
java.vm.version = 24.65-b04
sun.boot.library.path = /usr/java/jdk1.7.0_67-cloudera/jre/lib/amd64
java.vendor.url = http://java.oracle.com/
java.vm.vendor = Oracle Corporation
path.separator = :
file.encoding.pkg = sun.io
java.vm.name = Java HotSpot(TM) 64-Bit Server VM
sun.os.patch.level = unknown
sun.java.launcher = SUN_STANDARD
user.country = CN
user.dir = /opt/bin/spark_dev_job
java.vm.specificat