Java命令:jinfo — 查看进程参数

目录

  • 一、简介
  • 二、常用命令
    • 1、jinfo -flags pid : 打印当前指定java进程中已经设定的所有JVM参数信息
    • 2、jinfo -flag pid : 打印指定名称的参数
    • 3、jinfo -flag [+|-] pid : 打开或关闭参数
    • 4、jinfo -sysprops pid : 打印当前java进程中设定的系统环境参数

一、简介

jinfoJDK 自带的命令,可以用来查看正在运行的 java 应用程序的扩展参数,包括Java System属性和JVM命令行参数;也可以动态的修改正在运行的 JVM 一些参数。当系统崩溃时,jinfo可以从core文件里面知道崩溃的Java应用程序的配置信息。

jinfo -help

输出结果:

> jinfo -help
Usage:jinfo [option] <pid>(to connect to running process)jinfo [option] <executable <core>(to connect to a core file)jinfo [option] [server_id@]<remote server IP or hostname>(to connect to remote debug server)where <option> is one of:-flag <name>         to print the value of the named VM flag-flag [+|-]<name>    to enable or disable the named VM flag-flag <name>=<value> to set the named VM flag to the given value-flags               to print VM flags-sysprops            to print Java system properties<no option>          to print both of the above-h | -help           to print this help message

参数说明:

  • -flag <name> :打印指定名称的参数。
  • -flag [+|-]<name> :打开或关闭参数。
  • -flag <name>=<value> :设置参数。
  • -flags :打印当前指定java进程中已经设定的所有JVM参数信息。
  • -sysprops :打印当前java进程中设定的系统环境参数。
  • <no option> :打印上面两个选项。

二、常用命令

1、jinfo -flags pid : 打印当前指定java进程中已经设定的所有JVM参数信息

jinfo -flags 7663

输出结果:

Attaching to process ID 7663, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.121-b13
Non-default VM flags: -XX:CICompilerCount=4 -XX:InitialHeapSize=268435456 -XX:MaxHeapSize=4294967296 -XX:MaxNewSize=1431306240 -XX:MinHeapDeltaBytes=524288 -XX:NewSize=89128960 -XX:OldSize=179306496 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseFastUnorderedTimeStamps -XX:+UseParallelGC
Command line:  -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=49834:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8

2、jinfo -flag pid : 打印指定名称的参数

其中,<name> 不包含上图的前缀 -XX: 等,不是 jinfo -flag -XX:NewSize 7663,而是 jinfo -flag NewSize 7663,不包含 -XX:

jinfo -flag NewSize 7663

输出结果:

-XX:NewSize=89128960

3、jinfo -flag [+|-] pid : 打开或关闭参数

jinfo -flag +PrintGC 7663

执行上面命令后,执行如下命令查看结果:

jinfo -flags 7663

输出结果:
在这里插入图片描述
从图中我们可以看到参数已经打开。


4、jinfo -sysprops pid : 打印当前java进程中设定的系统环境参数

jinfo -sysprops 7663

输出结果:

Attaching to process ID 7663, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.121-b13
java.runtime.name = Java(TM) SE Runtime Environment
java.vm.version = 25.121-b13
sun.boot.library.path = /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib
gopherProxySet = false
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 = /Users/davis/workspace/intellij/cw-javaagent-demo
java.vm.specification.name = Java Virtual Machine Specification
java.runtime.version = 1.8.0_121-b13
java.awt.graphicsenv = sun.awt.CGraphicsEnvironment
os.arch = x86_64
java.endorsed.dirs = /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/endorsed
line.separator =java.io.tmpdir = /var/folders/5n/6g464jd97r13x39t5w69ybfr0000gn/T/
java.vm.specification.vendor = Oracle Corporation
os.name = Mac OS X
sun.jnu.encoding = UTF-8
java.library.path = /Users/davis/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
java.specification.name = Java Platform API Specification
java.class.version = 52.0
sun.management.compiler = HotSpot 64-Bit Tiered Compilers
os.version = 10.15.5
http.nonProxyHosts = local|*.local|169.254/16|*.169.254/16
user.home = /Users/davis
user.timezone = Asia/Shanghai
java.awt.printerjob = sun.lwawt.macosx.CPrinterJob
file.encoding = UTF-8
java.specification.version = 1.8
user.name = davis
java.class.path = /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/lib/tools.jar:/Users/davis/workspace/intellij/cw-javaagent-demo/target/classes:/Users/davis/maven/net/sourceforge/jtds/jtds/1.2.6/jtds-1.2.6.jar:/Users/davis/maven/jstl/jstl/1.2/jstl-1.2.jar:/Users/davis/maven/taglibs/standard/1.1.2/standard-1.1.2.jar:/Users/davis/maven/org/mybatis/mybatis/3.2.8/mybatis-3.2.8.jar:/Users/davis/maven/org/mybatis/mybatis-spring/1.2.2/mybatis-spring-1.2.2.jar:/Users/davis/maven/redis/clients/jedis/2.5.2/jedis-2.5.2.jar:/Users/davis/maven/org/apache/commons/commons-pool2/2.0/commons-pool2-2.0.jar:/Users/davis/maven/mysql/mysql-connector-java/5.1.39/mysql-connector-java-5.1.39.jar:/Users/davis/maven/org/springframework/spring-aop/4.1.1.RELEASE/spring-aop-4.1.1.RELEASE.jar:/Users/davis/maven/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:/Users/davis/maven/org/springframework/spring-aspects/4.1.1.RELEASE/spring-aspects-4.1.1.RELEASE.jar:/Users/davis/maven/org/aspectj/aspectjweaver/1.8.2/aspectjweaver-1.8.2.jar:/Users/davis/maven/org/springframework/spring-beans/4.1.1.RELEASE/spring-beans-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-context/4.1.1.RELEASE/spring-context-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-context-support/4.1.1.RELEASE/spring-context-support-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-core/4.1.1.RELEASE/spring-core-4.1.1.RELEASE.jar:/Users/davis/maven/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/Users/davis/maven/org/springframework/spring-expression/4.1.1.RELEASE/spring-expression-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-instrument/4.1.1.RELEASE/spring-instrument-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-instrument-tomcat/4.1.1.RELEASE/spring-instrument-tomcat-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-jdbc/4.1.1.RELEASE/spring-jdbc-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-jms/4.1.1.RELEASE/spring-jms-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-messaging/4.1.1.RELEASE/spring-messaging-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-orm/4.1.1.RELEASE/spring-orm-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-oxm/4.1.1.RELEASE/spring-oxm-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-test/4.1.1.RELEASE/spring-test-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-tx/4.1.1.RELEASE/spring-tx-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-web/4.1.1.RELEASE/spring-web-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-webmvc/4.1.1.RELEASE/spring-webmvc-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-webmvc-portlet/4.1.1.RELEASE/spring-webmvc-portlet-4.1.1.RELEASE.jar:/Users/davis/maven/org/springframework/spring-websocket/4.1.1.RELEASE/spring-websocket-4.1.1.RELEASE.jar:/Users/davis/maven/commons-fileupload/commons-fileupload/1.3.1/commons-fileupload-1.3.1.jar:/Users/davis/maven/commons-io/commons-io/2.2/commons-io-2.2.jar:/Users/davis/maven/commons-dbcp/commons-dbcp/1.2.2/commons-dbcp-1.2.2.jar:/Users/davis/maven/commons-pool/commons-pool/1.4/commons-pool-1.4.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar
java.vm.specification.version = 1.8
sun.arch.data.model = 64
sun.java.command = com.cw.tsb.jvm.JVMTest
java.home = /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre
user.language = zh
java.specification.vendor = Oracle Corporation
awt.toolkit = sun.lwawt.macosx.LWCToolkit
java.vm.info = mixed mode
java.version = 1.8.0_121
java.ext.dirs = /Users/davis/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
sun.boot.class.path = /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/jre/classes
java.vendor = Oracle Corporation
file.separator = /
java.vendor.url.bug = http://bugreport.sun.com/bugreport/
sun.io.unicode.encoding = UnicodeBig
sun.cpu.endian = little
socksNonProxyHosts = local|*.local|169.254/16|*.169.254/16
ftp.nonProxyHosts = local|*.local|169.254/16|*.169.254/16
sun.cpu.isalist =



本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/446734.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C++primer第八章 IO库 8.1 IO类

IO库设施 istream &#xff08;输入流&#xff09;类型&#xff0c;提供输入操作。ostream &#xff08;输出流&#xff09;类型&#xff0c;提供输出操作。cin,—个 istream对象&#xff0c;从标准输入读取数据。cout, 一个ostream对象&#xff0c;向标准输出写入数据。cerr…

2014年英语一作文partB漫画作文

题目 Write an essay of 160-200 words based on the following drawing.In your essay you should describe the drawing brieflyexplain its intended meaning,give your comments 做题点 1.使用三段式,第一段:图片内容;第二段:图片暗示;第三段:写自己的评论 2.描述图片…

Spring Cloud 系列之 Nacos 配置中心

目录一、Nacos简介二、Nacos安装及配置1、环境准备2、安装包下载&#xff08;1&#xff09;源码方式&#xff08;2&#xff09;发行包方式3、启动Nacos服务4、Nacos数据库配置&#xff08;1&#xff09;MySQL数据源&#xff08;2&#xff09;初始化 MySQL 数据库&#xff08;3&…

C++primer第八章 IO库 8.2 文件输入输出

8.2文件输入输出 头文件fstream定义了三个类型来支持文件IO&#xff1a;ifstream从一个给定文件读取数据&#xff0c;ofstream向一个给定文件写入数据&#xff0c;以及fstream可以读写给定文件。在17.5.3节中&#xff08;第676页&#xff09;我们将介绍如何对同一个文件流既读…

SpringBoot 集成 Nacos

目录一、前言二、Nacos集成1、引入Nacos依赖2、设置Nacos配置3、加载Nacos配置中心配置项4、Nacos集成验证5、Nacos配置中心配置项动态生效Nacos安装详见&#xff1a;Spring Cloud 系列之 Nacos 配置中心 一、前言 上一篇已经讲解了怎样安装安装、启动、配置 Nacos&#xff0c…

C++primer第八章 IO库 8.3string流

8.3string流 sstream头文件定义了三个类型来支持内存IO,这些类型可以向string写入数据,从string读取数据&#xff0c;就像string是一个IO流一样。istringstream从string读取数据&#xff0c;ostringstream向string写入数据&#xff0c;而头文件stringstream既可从string读数据…

英语口语海报演讲--东软

海报 海报上的内容 Nuclear waste water 1.Damage the devastating impact of nuclear radiation on the world 2.Marine life genetically mutated or dead 3.water resources polluted water resources 4.the future of humanity genetic damage/food and environment destr…

C++primer第九章 顺序容器 9.1 顺序容器概述 9.2容器库概览

一个容器就是一些特定类型对象的集合。顺序容器(sequentialcontainer)为程序员提供了控制元素存储和访问顺序的能力。这种顺序不依赖于元素的值&#xff0c;而是与元素加入容器时的位置相对应。与之相对的&#xff0c;我们将在第11章介绍的有序和无序关联容器&#xff0c;则根据…

C++primer第九章 顺序容器 9.3 顺序容器操作

9.3顺序容器操作 顺序容器和关联容器的不同之处在于两者组织元素的方式。这些不同之处直接关系到了元素如何存储、访问、添加以及删除。上一节介绍了所有容器都支持的操作&#xff08;罗列于表9.2&#xff08;第295页&#xff09;&#xff09;。本章剩余部分将介绍顺序容器所特…

C++primer第九章 顺序容器 9.4 vector对象是如何增长的

为了支持快速随机访问&#xff0c;vector将元素连续存储&#xff0c;每个元素紧挨着前一个元素存储。通常情况下&#xff0c;我们不必关心一个标准库类型是如何实现的&#xff0c;而只需关心它如何使用。然而&#xff0c;对于vector和string,其部分实现渗透到了接口中。假定容器…

C++primer第九章 顺序容器 9.5 额外的string操作

除了顺序容器共同的操作之外&#xff0c;string类型还提供了一些额外的操作。这些操作中 的大部分要么是提供string类和C 风格字符数组之间的相互转换,要么是增加了允许我们用下标代替迭代器的版本。标准库string类型定义了大量函数。幸运的是&#xff0c;这些函数使用了重复的…

Zookeeper Mac下安装操作

目录一、下载Zookeeper二、修改配置1、设置启动配置文件2、修改配置三、启动Zookeeper服务命令1、bin目录下执行&#xff08;1&#xff09;启动Zookeeper命令&#xff08;2&#xff09;查看Zookeeper状态命令&#xff08;3&#xff09;停止Zookeeper命令2、配置环境变量执行&am…

2014年考研英语二作文PartB图表题

作文详细解析 题目 Write an essay based on the following chart, in which you should interpret the chart, and give your comments You should write about 150 words on the ANSWER SHEET.(15 points) 注意点 1.图表题在第一段描述图表信息时,一定要写清楚y轴变化…

C++primer第九章 顺序容器 9.6 容器适配器

9.6容器适配器 除了顺序容器外&#xff0c;标准库还定义了三个顺序容器适配器&#xff1a;stack、queue和priority_queue适配器(adaptor)是标准库中的一个通用概念。容器、迭代器和函数<369I都有适配器。本质上&#xff0c;一个适配器是一种机制&#xff0c;能使某种事物的…

SpringBoot Controller接收参数的常用方式

文章目录一、请求路径参数1、PathVariable二、Body参数1、RequestParam2、RequestBody三、请求头参数和Cookie参数1、RequestHeader2、CookieValue一、请求路径参数 1、PathVariable 注解为&#xff1a; org.springframework.web.bind.annotation.PathVariable获取路径参数&…

C++primer第十章 泛型算法 10.1 概述 10.2 初识泛型算法

大多数算法都定义在头文件algorithm中。标准库还在头文件numeric中定义了 一组数值泛型算法一般情况下&#xff0c;这些算法并不直接操作容器&#xff0c;而是遍历由两个迭代器指定的一个元素范围(参见9.2.1节&#xff0c;第296页)来进行操作。通常情况下&#xff0c;算法遍历范…

MySQL Mac安装教程

文章目录一、下载安装包二、安装三、启动MySQL四、环境变量设置一、下载安装包 下载地址&#xff1a;https://downloads.mysql.com/archives/community/ 二、安装 双击安装包&#xff0c;然后一直点继续即可。 三、启动MySQL 打开 系统偏好设置&#xff0c;会发现多了一个…

C++生成指定范围内的随机数

代码 rand&#xff08;&#xff09;% 3 &#xff1b; 3就是范围&#xff0c;代表生成[0,3)之间的随机数 int main(){for (int i 0; i < 20; i) {switch (rand() % 3) {case 0:std::cout << "00" << std::endl;case 1:std::cout << "11&q…

C++primer第十章 泛型算法 10.3 定制操作

10.3定制操作 很多算法都会比较输入序列中的元素。默认情况下&#xff0c;这类算法使用元素类型的&#xff1c;或运算符完成比较。标准库还为这些算法定义了额外的版本&#xff0c;允许我们提供自己定义的操作来代替默认运算符。例如&#xff0c;sort算法默认使用元素类型的&l…

C++primer第十章 泛型算法 10.4 再探迭代器 10.5 泛型算法结构

除了为每个容器定义的迭代器之外&#xff0c;标准库在头文件iterator中还定义了额外几种迭代器。这些迭代器包括以下几种。插入迭代器(insert iterator)&#xff1a;这些迭代器被绑定到一个容器上&#xff0c;可用来向容器插入元素。流迭代器(stream iterator)&#xff1a;这些…