I'm running java server on Red Hat Enterprise Linux Server release 5.9. Recently I started to use HugePages as it has some advantages I would like to use. System was configured correctly (as many sites and blog states) and 40G of RAM was set for hugepages to use.
Hugepagesize: 2048 kB
Total RAM on server: 128G. After setting hugePages machine was rebooted and server process started in hugePages with Heap size of 29G. All went smooth. Lately I did some changes in jvm parameters and increased Heap size to 30G. When jvm process was restarted it did not used hugepages. Error in log showed up:
Java HotSpot(TM) Server VM warning: Failed to reserve shared memory (errno = 22)
I did some testing to make sure that other changes in java parameters did not caused this and conclusion was that increasing heap size was the reason.
Now I don't get it. System shows no hugePages used at all, so 40G of space left and still java can't reserve 30G of it.
Can anybody explain why this is happening?
More important is there any way to make sure that it won't happen in the future?
This is production system so if I create final configuration it won't be able to run java process outside hugePages as there will be no space left. Final config will be 96G of hugePages with one 32GB java process working constantly and with reserve resources to run two more such processes in case of emergency. I have to make sure that when such emergency happens java processes will be able to use hugePages.
Any help would be great.