Skip to content

VisualVM

VisualVM is a tool that can connect to a running Java Virtual Machine (JVM) and provide real-time analysis capabilities into how stack and heap is being used within the environment. This is useful for troubleshooting memory leaks and class interaction at the JVM level.

Preparing to use VisualVM

  • Download VisualVM from the website

  • Unzip it the WPILib installation folder

    • Windows (Powershell)
      Expand-Archive -Path $env:USERPROFILE\Downloads\visualvm_221.zip -DestinationPath C:\Users\Public\wpilibZ-Force
      
    • Linux
      unzip ~/Downloads/visualvm_221.zip ~/wpilib/
      
  • Follow the instructions on the Profiling with VisualVM page to modify the build.gradle file.

Running VisualVM

  • Launch the VisualVM environment
    • Windows (Powershell)
      cd "C:\Users\Public\wpilib\visualvm_2110\bin"
      ./visualvm --jdkhome "C:\Users\Public\wpilib\2026\jdk"
      
    • Linux
      cd ~/wpilib/visualvm_2110/bin
      ./visualvm --jdkhome ~/wpilib/2026/jdk
      

Resources