---
title: "为什么会\"well-known file is not secure\" ?"
author: "lkf520java"
date: "2012-06-14T10:41:43Z"
tags: []
categories: ["编程语言"]
slug: "well-known-file-is-not-secure"
draft: false
lastmod: "2012-06-14T10:41:43Z"
id: 1560686
url: "https://lkf520java.iteye.com/blog/1560686"
---

最近一段时间经常使用JDK自带工具jmap和jstack来dump JVM heap和JVM 线程栈的log来分析问题，执行这两个命令当时让我最摸不着头脑的就是碰到这个问题：well-known file is not secure

eg:

     
![](http://dl.iteye.com/upload/attachment/0069/5267/b9b71063-e466-3813-9971-e165a1f36b95.jpg)

  上网google了一把，在stackoverflow上找到答案：http://stackoverflow.com/questions/9100149/jstack-well-known-file-is-not-secure?rq=1，大概意思是:

 

     我们可以在机器上找到 /tmp/hsperfdata\_$USER/$PID一个这样的文件，当我们执行jmap或者jstack出现上叙信息时，先检查执行该命令的用户是否和hsperfdata\_$USER这个文件所属的用户一致，如果不一致，切换至成一致再执行即可。