Java 远程调试开销

Java remote debugging overhead

我只是想知道远程调试的额外开销。我使用带有这些参数的 HotSpot 启动应用程序:

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

我听说旧版本的 HotSpot 对性能有很大影响,但我的应用程序现在使用 java 8,我找不到任何关于它的最新信息。

AMD 的这篇文章将帮助您了解这会导致多少性能下降,他们甚至进行了一些调整以减少在 Hotspot JVM 上远程调试造成的性能损失,我引用:

"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/

1.4.0 介绍 "Full Speed Debugging" : 在以前的 HotSpot 版本中(1.4.0 之前),启用调试时,程序仅使用解释器执行。从 1.4.0 开始,HotSpot 技术的全部性能优势可用于启用调试的程序 运行。 改进的性能 使较长的 运行 程序更容易调试。

在 1.4.1 之后,Oracle 在 JPDA 区域中没有提到与性能相关的增强。最后一个是在 JDK 1.4.0 中为 Java 热点客户端虚拟机和 Java 热点服务器虚拟机在 JDK 1.4.1 中完成的。

因此可以肯定地说,从 1.4.1 到最新版本,调试区域的性能不会有任何改进。否则它会被 oracle 文档提到。

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

请通过上述 link 增强部分下的 link 进行确认。