Skip to content
Derek Clemenzi edited this page Apr 26, 2021 · 6 revisions

Remote Debugging

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5006 -jar <jar name>

or you can use

export JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5006"
java $JAVA_OPTS -jar <jar name>

Create a Remote run configuration:

  1. Run -> Edit Configurations...
  2. Click the "+" in the upper left
  3. Select the "Remote" option in the left-most pane
  4. Choose a name (I named mine "remote-debugging")
  5. Click "OK" to save:

Start your application as you would normally, then in IntelliJ select the new configuration and hit 'Debug'.

https://stackoverflow.com/questions/21114066/attach-intellij-idea-debugger-to-a-running-java-process

JConsole

Port forwarding

ssh -L 9010:localhost:9010 -L 9011:localhost:9011 <username>@<ip>

jconsole localhost:9010

JMAP

java-1.8.0-openjdk-devel-1.8.0.292.b10-1.el7_9.x86_64

sudo -u tomcat /bin/jmap -dump:live,format=b,file=/home/carolina/mw-dump <PID>

Clone this wiki locally