观察运行中的java程序的运行环境参数:参数包括Java System属性,各种.properties文件配置参数和JVM命令行参数
# jinfo $(pgrep java) Attaching to process ID 15888, please wait... Debugger attached successfully. Server compiler detected. JVM version is 24.72-b04 Java System Properties: java.vendor = Oracle Corporation sun.java.launcher = SUN_STANDARD catalina.base = /srv/apache-tomcat sun.management.compiler = HotSpot 64-Bit Tiered Compilers catalina.useNaming = true captcha.times = 5 os.name = Linux ... ... java.vm.name = Java HotSpot(TM) 64-Bit Server VM cpool.maxIdleTime = 7200 file.encoding = UTF-8 java.specification.version = 1.7 VM Flags: -Djava.util.logging.config.file=/srv/apache-tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms512m -Xmx8192m -XX:PermSize=64M -XX:MaxPermSize=512m -Djava.endorsed.dirs=/srv/apache-tomcat/endorsed -Dcatalina.base=/srv/apache-tomcat -Dcatalina.home=/srv/apache-tomcat -Djava.io.tmpdir=/srv/apache-tomcat/temp
实例二
# jinfo $(jps | grep Bootstrap | cut -d " " -f1) Attaching to process ID 15888, please wait... Debugger attached successfully. Server compiler detected. JVM version is 24.72-b04 Java System Properties: java.vendor = Oracle Corporation sun.java.launcher = SUN_STANDARD catalina.base = /srv/apache-tomcat sun.management.compiler = HotSpot 64-Bit Tiered Compilers catalina.useNaming = true captcha.times = 5 os.name = Linux
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。