Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java remote debugging overhead

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.

like image 796
Tymur Yarosh Avatar asked Feb 08 '16 11:02

Tymur Yarosh


People also ask

What is remote debugging in Java?

Remote Java Debugging is the process of debugging a Java program or application running on another machine or a server environment.

Why is IntelliJ debugging slow?

Remove breakpoints off your method and use them inside the method as that can cause your debug to take a very long time. Try running IntelliJ as admin. I had this issue at work where debugging was extremely slow and running as admin actually made it a lot faster.

What is remote debugging?

In simple terms, remote debugging is debugging an application that runs in a place other than your local environment. This is usually done by connecting the remotely running application with your development environment.


2 Answers

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.

like image 168
Sumit Rathi Avatar answered Oct 03 '22 22:10

Sumit Rathi


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/

like image 24
Ghayth Avatar answered Oct 03 '22 23:10

Ghayth