2015-09-11 23 views
0

我正在學習一些JVM工具,如jstat,JMAP,jtack等。當我在命令行中鍵入jstat,它具有以下消息的響應:-J選項在jstat中的含義是什麼?

Usage: 
    jmap [option] <pid> 
     (to connect to running process) 
    jmap [option] <executable <core> 
     (to connect to a core file) 
    jmap [option] [[email protected]]<remote server IP or hostname> 
     (to connect to remote debug server) 

where <option> is one of: 
    <none>    to print same info as Solaris pmap 
    -heap    to print java heap summary 
    -histo[:live]  to print histogram of java object heap; if the "live" 
         suboption is specified, only count live objects 
    -permstat   to print permanent generation statistics 
    -finalizerinfo  to print information on objects awaiting finalization 
    -dump:<dump-options> to dump java heap in hprof binary format 
         dump-options: 
          live   dump only live objects; if not specified, 
             all objects in the heap are dumped. 
          format=b  binary format 
          file=<file> dump heap to <file> 
         Example: jmap -dump:live,format=b,file=heap.bin <pid> 
    -F     force. Use with -dump:<dump-options> <pid> or -histo 
         to force a heap dump or histogram when <pid> does not 
         respond. The "live" suboption is not supported 
         in this mode. 
    -h | -help   to print this help message 
    -J<flag>    to pass <flag> directly to the runtime system 

的問題是,我很困惑與選項-J。

-J<flag>    to pass <flag> directly to the runtime system 

當我鍵入jstat -J-version,它說

java version "1.6.0_22" 
Java(TM) SE Runtime Environment (build 1.6.0_22-b04) 
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode) 

是什麼使用此選項又是什麼 「旗」 意味着什麼?

+0

您是否考慮過諮詢[documentation](http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstat.html)? – EJP

+3

@EJP我認爲這很明顯,他確實閱讀了文檔,因爲它在他的問題中有很好的記錄。 – Craig

+0

@EJP我認爲'將直接傳遞給運行時系統'的幫助信息是該選項的官方說明,但我不明白這一點。因此,我用關鍵字'傳遞'直接搜索到谷歌,而不是'jstat',因此我得不到任何有價值的東西。在閱讀EJP提到的文檔後,相當清楚 - -J只是表示javaOption.Much謝謝。 –

回答

2

這意味着它將該標誌傳遞給jstat調用的子JVM進程。

例如,jstat -J-version有效調用:

java -version 

具有打印出JVM版本的效果。

3

的Oracle在線文檔有關jstat更加清晰:

-JjavaOption

通行證的javaoption到Java應用程序啓動。例如,-J-Xms48m將啓動內存設置爲48 MB。有關選項的完整列表,請參閱java(1)。

此選項用於將Java選項傳遞給運行時JRE,如設置內存大小。可能的選項列表可以查看here

+0

謝謝。閱讀完Oracle Docs後,我非常清楚。我用關鍵字'pass '直接搜索到了運行時系統而不是'jstat',結果我沒有任何價值。 –

相關問題