Getting the parameters of a running JVM

前端 未结 12 634
栀梦
栀梦 2020-12-04 05:43

Is there a way to get the parameters of a running JVM? Is there a command line tool like jstat which takes as input the pid of the JVM and returns its starting parameters? I

12条回答
  •  半阙折子戏
    2020-12-04 06:27

    On Linux:

    java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'
    

    On Mac OSX:

    java -XX:+PrintFlagsFinal -version | grep -iE 'heapsize|permsize|threadstacksize'
    

    On Windows:

    C:\>java -XX:+PrintFlagsFinal -version | findstr /i "HeapSize PermSize ThreadStackSize"
    

    Source: https://www.mkyong.com/java/find-out-your-java-heap-memory-size/

提交回复
热议问题