Claus-Theodor Riegg
1 year
Moritz Kraus
1 year
Claus-Theodor Riegg
1 year
Stefan Xenopol
1 year

Check JVM settings of running java process

Posted . Visible to the public.

If you want to check the configuration of a running JVM process you can use jcmd.

  1. List the running processes:

    $ jcmd -l
    1 /app.jar
    140 jdk.jcmd/sun.tools.jcmd.JCmd -l
    

    The first column shows the PID of the process.

  2. Print system configuration with the PID:

    $ jcmd 1 VM.system_properties
    1:
    #Thu Jan 26 10:34:20 UTC 2023
    java.specification.version=17
    sun.jnu.encoding=UTF-8
    java.class.path=/app.jar
    java.vm.vendor=Eclipse Adoptium
    sun.arch.data.model=64
    catalina.useNaming=false
    java.vendor.url=https\://adoptium.net/
    user.timezone=Etc/UTC
    os.name=Linux
    java.vm.specification.version=17
    sun.java.launcher=SUN_STANDARD
    user.country=US
    sun.boot.library.path=/opt/java/openjdk/lib
    sun.java.command=/app.jar
    jdk.debug=release
    sun.cpu.endian=little
    user.home=/home/spring
    user.language=en
    java.specification.vendor=Oracle Corporation
    java.version.date=2023-01-17
    java.home=/opt/java/openjdk
    file.separator=/
    java.vm.compressedOopsMode=32-bit
    line.separator=\n
    java.specification.name=Java Platform API Specification
    java.vm.specification.vendor=Oracle Corporation
    FILE_LOG_CHARSET=UTF-8
    java.awt.headless=true
    java.protocol.handler.pkgs=org.springframework.boot.loader
    sun.management.compiler=HotSpot 64-Bit Tiered Compilers
    java.runtime.version=17.0.6+10
    user.name=spring
    path.separator=\:
    os.version=5.4.219-126.411.amzn2.x86_64
    java.runtime.name=OpenJDK Runtime Environment
    file.encoding=UTF-8
    java.vm.name=OpenJDK 64-Bit Server VM
    java.vendor.version=Temurin-17.0.6+10
    java.vendor.url.bug=https\://github.com/adoptium/adoptium-support/issues
    java.io.tmpdir=/tmp
    catalina.home=/tmp/tomcat.8080.11647654595355715119
    java.version=17.0.6
    user.dir=/
    os.arch=amd64
    java.vm.specification.name=Java Virtual Machine Specification
    PID=1
    CONSOLE_LOG_CHARSET=UTF-8
    catalina.base=/tmp/tomcat.8080.11647654595355715119
    native.encoding=UTF-8
    java.library.path=/usr/java/packages/lib\:/usr/lib64\:/lib64\:/lib\:/usr/lib
    java.vm.info=mixed mode, sharing
    java.vendor=Eclipse Adoptium
    java.vm.version=17.0.6+10
    sun.io.unicode.encoding=UnicodeLittle
    java.class.version=61.0
    
  3. Print flags of the process with PID:

    $  jcmd 1 VM.flags
    -XX:CICompilerCount=2 -XX:InitialHeapSize=8388608 -XX:MaxHeapSize=134217728 -XX:MaxNewSize=44695552 -XX:MinHeapDeltaBytes=196608 -XX:MinHeapSize=8388608 -XX:NewSize=2752512 -XX:NonNMethodCodeHeapSize=5826188 -XX:NonProfiledCodeHeapSize=122916026 -XX:OldSize=5636096 -XX:ProfiledCodeHeapSize=122916026 -XX:ReservedCodeCacheSize=251658240 -XX:+SegmentedCodeCache -XX:SoftMaxHeapSize=134217728 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseFastUnorderedTimeStamps -XX:+UseSerialGC 
    
Claus-Theodor Riegg
Last edit
Claus-Theodor Riegg
License
Source code in this card is licensed under the MIT License.