当前位置: 代码迷 >> 综合 >> 001 Can't attach to the process
  详细解决方案

001 Can't attach to the process

热度:25   发布时间:2024-01-04 13:34:58.0

[top]

### 一 问题
执行jinfo -flags pid报错,错误信息如下:

Attaching to process ID 25985, please wait...
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process
sun.jvm.hotspot.debugger.DebuggerException: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process
****

二 解决方案

执行如下命令可解决:

echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

再次执行命令如下:

**-OptiPlex-3020:~/桌面$ jinfo -flags 25985
Attaching to process ID 25985, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.45-b02
Non-default VM flags: -XX:CICompilerCount=3 -XX:InitialHeapSize=130023424 -XX:MaxHeapSize=2069889024 -XX:MaxNewSize=689963008 -XX:MinHeapDeltaBytes=524288 -XX:NewSize=42991616 -XX:OldSize=87031808 -XX:+UseCompressedClassPointers -XX:+UseCompressedOops
  相关解决方案