idea远程debug

启动命令

nohup java \
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=50055 \
-jar remote-debug-0.0.1-SNAPSHOT.jar &

可能问题

系统的文件描述符限制

root@code-server:/usr/jar# ./start-debug.sh config-service
JAR 包 config-service/config-service.jar 已启动,日志输出到 ./log/config-service.log 文件。
开始实时查看日志...
Listening for transport dt_socket at address: 8099
library initialization failed - unable to allocate file descriptor table - out of memory

永久提升系统文件描述符限制

# 编辑 /etc/security/limits.conf 文件

* soft nofile 65536
* hard nofile 65536

#这里的 * 代表所有用户,soft 表示软限制,hard 表示硬限制,nofile 表示文件描述符的数量。


#编辑 /etc/sysctl.conf 文件
fs.file-max = 65536

# 使配置生效

sysctl -p

IDEA配置

新建 remote JVM Debug
image

详细配置

image

断点成功

image

posted @ 2025-06-15 20:04  故木  阅读(9)  评论(0)    收藏  举报