远程连接测试服务器进行调试:测试环境是LINUX系统:(不要在生产环境使用,容易被攻击)JDWP 是 Java Debug Wire Protocol 的缩写,在JPDA(Java Platform Debugger Architecture)中,它定义了调试器(debugger
for { if { count++;如果你在多处添加了这种断点,简单的看 log 可能偶尔还是不够直观,可以勾选上面图片绿色框线的 :Breakpoint reached at top.dayarch.TestDebug.isInterestedinterested 6Breakpoint reached at top.dayarch.TestDebug.isInterestedinterested 0Breakpoint reached at top.dayarch.TestDebug.isInterestedinterested 9Breakpoint reached at top.dayarch.TestDebug.isInterestedinterested 8Breakpoint reached at top.dayarch.TestDebug.isInterestedinterested 1Found 3 interested valuesDisconnected from the target VM, address: '127.0.0.1:0', transport: 'socket'Process finished with exit code。
通常,当我们遇到这些类型的性能问题时,我们怀疑是 I/O 接口导致的。你可以为在远程环境中执行的Java应用程序使用 debugger,满足以下条件:* 该应用程序启动时应该附带一个 debugger agent。
JPDA is a multi-tiered debugging architecture that allows tools developers to easily create debugger applications which run portably across platforms, virtual machine implementations and JDK versions.
IDEA的远程开发功能,可以将本地的编译、构建、调试、运行等工作都放在远程服务器上执行,而本地仅运行客户端软件进行常规的开发操作即可,官方给出的逻辑图如下,可见通过本地的IDE和服务器上的IDE backend将本地电脑和服务器打通,实现了远程开发的效果。
我们在使用 IDEA DEBUG调试代码的时候,常常见到控制台会输出一句这样的话:「Connected to the target VM, address: '127.0.0.1:62981', transport: 'socket'」,所以即使代码不在本地运行,只要JVM打开调试模式,并且网络能够用过 socket 连接到JVM,使用 Debug 协议通过 Socket 通信就可以传递调试指令和调试信息。