jps 命令內容中出現Insufficient space for shared memory file:

#jps  報錯了 Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file:     /tmp/hsperfdata_root/15746 Try using the -Djava.io.tmpdir= option to select an alternate temp location. df -h 發現某一個滿的分區 清理一些日誌文件 恢復正常 起namenode時,hadoop報錯: Java HotSpot(TM) 64-Bit Server VM warning: Insufficient space for shared memory file: /tmp/hsperfdata_work/23408 Try using the -Djava.io.tmpdir= option to select an alternate temp location. 錯誤解決後,搜索學習這個 /tmp/hsperfdata_$user/$number的做用: That directory is part of a Java performance counter. 這個文件存的應該是JVM進程當前的一些性能參數(或者說運行信息) jvmstat會生成一個目錄文件叫hsperfdata_username,那這個目錄文件在哪裏呢,默認的是生成在 java.io.tmpdir目錄下, java.io.tmpdir在linux下默認是/tmp下,故默認開啓了jvm monitor的功能之後就會在/tmp目錄下生成一個目錄叫 hsperfdata_username ,而後這個目錄中會有一個pid文件,能夠利用strings查看裏面的文件內容,通常就是jvm的進程信息而已。 而jps、jconsole、jvisualvm等工具的數據來源就是這個文件(/tmp/hsperfdata_userName/pid)。因此當該文件不存在或是沒法讀取時就會出現jps沒法查看該進程號,jconsole沒法監控等問題 /tmp/hsperfdata_userName/pid文件會在對應java進程退出後被清除。若是java進程非正常退出(如kill -9),那麼pid文件會被保留,直到執行一次java命令或是加載了jvm程序的命令(如jps、javac、jstat),會將全部無用的pid文件都清除掉