How to Solve JAVA Error: “well-known file is not secure” ?

Recently, JDK tools jmap and jstack are often used to dump JVM heap and JVM thread stack log to analyze problems. When executing these two commands, I was most puzzled when I encountered this problem: well-known file is not secure


Google the Internet and find the answer on stackoverflow

It means:

We can find/TMP/hsperfdata on the machine_ $user/$PID is such a file. When we execute jmap or jstack, we first check whether the user executing the command is in contact with hsperfdata_ The users of the $user file are consistent. If not, switch to consistent and then execute.

Get current heap snapshot

jmap – dump:format=b ,file=./ heap.hprof 20344(pid)
20344: well-known file is not secure

sudo -u app-cfg-api jmap – dump:format=b ,file=./ heap.hprof 20344
Dumping heap to /tmp/hsperfdata_ app-cfg-api/ heap.hprof …
Heap dump file created

Similar Posts: