Tag Archives: jhsdb jmap heap pid 1

jhsdb jmap –heap –pid 1 Command Error [How to Solve]

1. View the heap usage of the running Java docker service. The command jhsdb jmap — heap — PID 1 reports an error

Main error message:

ERROR: ptrace(PTRACE_ATTACH, ..) failed for 1: Operation not permitted
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can’t attach to the process: ptrace(PTRACE_ATTACH, ..) failed for 1: Operation not permitted

reason:

Docker has added security features since version 1.10. JDK tools such as jmap rely on Linux’s ptrace_ Attach, and docker since version 1.10, ptrace is disabled in the default seccomp configuration file. The container needs to add corresponding settings to enable the container to support the use of relevant commands.

Solution:

1. Stop docker service systemctl stop docker

2.cd /Var/lib/docker/containers/container ID   Switch to container path

3.vi Hostconfig.json edit the configuration file and change the value of capadd to sys_PTRACE

4.   Restart docker service   systemctl start docker

Modified results: