Profiling

JConsole (simple)

Running jmx enabled java process can be debugged with JConsole which is part of the JDK. JConsole provides simple memory and thread profiling.

Connect to a remote JVM with the command

Example connect to the TEST7 HarvestJobManagerApplication on kb-test-adm-001.kb.dk with the following parameters:

Process: service:jmx:rmi:///jndi/rmi://kb-test-adm-001.kb.dk:8144/jmxrmi

Username: monitorRole

Password: test

VisualVM (advanced)

VisualVM is a very powerful and easy to use profiling tool. 

Setup

  • Download the newest Visual from: https://visualvm.dev.java.net/ (VisualVM is actually part of Sun's JDK distribution, but usually in a older version).
  • Start VisualVM as the user running the application to profil.
  • VisualVM displays all the running processes for the current user in the left menu. Open the relevant process and start investigating (smile)