Is there any performance hit if you start a java process with remote debugging enabled via jdwp/socket and no external process connects? I do understand there is a significant hit when there is a remote client actually debugging, but if I simply declare jdwp on a specific port, will that on its own slow the app? Any links to documentation would be greatly appreciated.
1 Answers
No, by just enabling the debugging port will have no effect on runtime performance as long as no external process connects.
JDWP is the protocol used for communication between a debugger and the Java virtual machine (VM) which it debugs. JDWP is optional.
JDWP Start Up - After the transport connection is established and before any packets are sent, a handshake occurs between the two sides of the connection:
The handshake process has the following steps:
- The debugger side sends 14 bytes to the VM side, consisting of the 14 ASCII characters of the string "JDWP-Handshake".
- The VM side replies with the same 14 bytes: JDWP-Handshake
In Java SE 1.4 the Java HotSpot virtual machine now uses "full-speed debugging"
In the previous version of HotSpot, when debugging was enabled, the program executed using only the interpreter. Now, the full performance advantage of HotSpot Technology is available to programs running with debugging enabled. The improved performance allows long running programs to be more easily debugged. It also allows testing to proceed at full speed and the launch of a debugger to occur on an exception:
For more details regarding JDWP Enhancements, please see http://docs.oracle.com/javase/1.5.0/docs/guide/jpda/jdwp-spec.html

- 3,677
- 3
- 17
- 40