1. 程式人生 > >jps 命令內容中出現Insufficient space for shared memory file:

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檔案都清除掉