2017-08-30 79 views

回答

1

無法保留共享內存當JVM無法爲共享內存中的Java堆分配大量頁面時,可能會顯示消息。這可能僅在-XX:+UseLargePages打開時發生。

errno = 12表示「內存不足」。

解釋從HotSpot sources

// Possible reasons for shmget failure: 
// 1. shmmax is too small for Java heap. 
// > check shmmax value: cat /proc/sys/kernel/shmmax 
// > increase shmmax value: echo "0xffffffff" > /proc/sys/kernel/shmmax 
// 2. not enough large page memory. 
// > check available large pages: cat /proc/meminfo 
// > increase amount of large pages: 
//   echo new_value > /proc/sys/vm/nr_hugepages 
//  Note 1: different Linux may use different name for this property, 
//   e.g. on Redhat AS-3 it is "hugetlb_pool". 
//  Note 2: it's possible there's enough physical memory available but 
//   they are so fragmented after a long run that they can't 
//   coalesce into large pages. Try to reserve large pages when 
//   the system is still "fresh". 

按照上面的說明或只是刪除-XX:+UseLargePages JVM選項。

相關問題