gpt4 book ai didi

java - 如何使用 jps -Joption

转载 作者:行者123 更新时间:2023-12-02 11:41:06 30 4
gpt4 key购买 nike

我真的不知道如何使用jsp -Joption。我得到的描述如下,

OPTIONS The jps command supports a number of options that modify the output of the command. These options are subject to change or removal in the future.

   -q             Suppress the output of the class name, JAR file name, and arguments passed to the main method,  producing  only  a  list  of
local VM identifiers.

-m Output the arguments passed to the main method. The output may be null for embedded JVMs.

-l Output the full package name for the application's main class or the full path name to the application's JAR file.

-v Output the arguments passed to the JVM.

-V Output the arguments passed to the JVM through the flags file (the .hotspotrc file or the file specified by the
-XX:Flags=<filename> argument).

-Joption Pass option to the java launcher called by javac. For example, -J-Xms48m sets the startup memory to 48 megabytes. It is a
common convention for -J to pass options to the underlying VM executing applications written in Java.

实际上,我不知道什么是 javac 调用的 java 启动器,当我运行示例 jps -J-Xms48m 时,就像使用 一样>jps。那么,这个选项有什么用呢?谢谢。

最佳答案

Java开发工具如jpsjstatjstackjmap等都是用Java编写的。就像常规 Java 程序一样,它们需要 Java 运行时环境,即它们在 JVM 下运行。

-J 选项不会直接影响 jps 工具,但会影响运行该工具的 JVM。例如。 -J-Xms48M 选项表示 jps 将启动初始堆大小为 48 MB 的 Java 虚拟机。

例如,比较jps -J-XX:+PrintGCDetailsjps -J-Xms48M -J-XX:+PrintGCDetails

关于java - 如何使用 jps -Joption,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48543458/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com