Java remote debugging overhead

1.6k Views Asked by At

I just wonder about additional overhead of remote debugging. I start application using HotSpot with these parameters:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

I heard about large impact on performance in much older versions of HotSpot but my application uses java 8 now and I can't find any up to date information about it.

2

There are 2 best solutions below

0
On BEST ANSWER

1.4.0 introduced "Full Speed Debugging" : In the previous version of HotSpot (prior to 1.4.0), when debugging was enabled, the program executed using only the interpreter. From 1.4.0 , the full performance advantage of HotSpot Technology was available to programs running with debugging enabled. The improved performance allows long running programs to be more easily debugged.

After 1.4.1 there are not performance related enhancement mentioned by oracle in JPDA area. Last one was done in JDK 1.4.0 for Java hotspot client VM and for Java Hotspot Server VM in JDK 1.4.1.

So it is safe to say that no performance improvement could be expected in debugging area from 1.4.1 to the latest version. Otherwise it would have been mentioned by oracle docs.

Sources: https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/

Please go through the links under the enhancement section of the above link to confirm.

1
On

This article from AMD will help you find how much performance degredation will this cause, they've even made some tweaks to reduce the performance hit caused by remote debugging on a Hotspot JVM, and I quote:

"We will also show how we applied these changes to improve the performance of the Hotspot JVM in the OpenJDK when it is started with debugging enabled but the debugger has not yet attached."

http://developer.amd.com/resources/documentation-articles/articles-whitepapers/java-performance-when-debugging-is-enabled/