Java remote debugging overhead
Asked Answered
U

2

9

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.

Unroll answered 8/2, 2016 at 11:13 Comment(3)
Indeed, there is a huge remote debugging overhead (30+ sec on a step into/over), unless you use SAP JVM on HCP (they have a special debugging service) - it's almost as if you are debugging locally. You can try it out at hanatrial.ondemand.comCatullus
@SvetlinZarev is this overhead enable only when someone connects to the jvm and starts debug or it remains all the time while agentlib is attached?Unroll
Oh, I misunderstood your question.Catullus
B
8

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.

Baldachin answered 15/2, 2016 at 20:23 Comment(0)
K
2

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/

Kibosh answered 11/2, 2016 at 8:5 Comment(1)
This article written in 2010. It was the time of java 6. Are you sure it is still up to date?Unroll

© 2022 - 2024 — McMap. All rights reserved.