2017-08-30 81 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选项。

相关问题