如果您启动一个通过 jdwp/socket 启用远程调试的 java 进程并且没有外部进程连接,是否会影响性能?我确实知道当远程客户端实际调试时会有很大的影响,但是如果我只是在特定端口上声明 jdwp,那么它本身会减慢应用程序吗?任何指向文档的链接将不胜感激.
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.
推荐答案否,只要没有外部进程连接,只启用调试端口对运行时性能没有影响.
No, by just enabling the debugging port will have no effect on runtime performance as long as no external process connects.
JDWP 是用于调试器与其调试的 Java 虚拟机 (VM) 之间通信的协议.JDWP 是可选的.
JDWP is the protocol used for communication between a debugger and the Java virtual machine (VM) which it debugs. JDWP is optional.
JDWP 启动 - 在建立传输连接之后,在发送任何数据包之前,连接的两端会发生握手:
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:
在 Java SE 1.4 中,Java HotSpot 虚拟机现在使用全速调试"
In Java SE 1.4 the Java HotSpot virtual machine now uses "full-speed debugging"
在以前的 HotSpot 版本中,当启用调试时,程序仅使用解释器执行.现在,在启用调试的情况下运行的程序可以使用 HotSpot 技术的全部性能优势.改进的性能允许更容易地调试长时间运行的程序.它还允许测试全速进行,并在出现异常时启动调试器:
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:
有关 JDWP 增强的更多详细信息,请参阅 docs.oracle/javase/1.5.0/docs/guide/jpda/jdwp-spec.html
For more details regarding JDWP Enhancements, please see docs.oracle/javase/1.5.0/docs/guide/jpda/jdwp-spec.html
更多推荐
Java远程调试——性能
发布评论