我真的无法弄清楚如何使用jsp -Joption。我的描述如下,
OPTIONS jps命令支持许多修改命令输出的选项。这些选项可能会更改或删除 将来
-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.
实际上,我不知道什么是java launcher called by javac
,当我使用jps -J-Xms48m
运行示例jps
时。那么,这个选项是什么?感谢。
答案 0 :(得分:1)
jps
,jstat
,jstack
,jmap
等Java开发工具都是用Java编写的。就像常规Java程序一样,它们需要Java Runtime Environment,即它们在JVM下运行。
-J
选项不会直接影响jps
工具,但它们会影响运行此工具的JVM。例如。 -J-Xms48M
选项意味着jps
将启动Java虚拟机,初始堆大小为48兆字节。
例如,比较jps -J-XX:+PrintGCDetails
和jps -J-Xms48M -J-XX:+PrintGCDetails