$ bin/java -Xms2560m -Xmx2560m -XlargePages -Xgc:genpar -XlargePages:exitOnFailure -version
[ERROR][osal ] Unable to open temporary file /mnt/hugepages/jrock8SadIG
[ERROR][memory ] Could not acquire large pages for Java heap.
[ERROR][memory ] Could not setup java heap.
Could not create the Java virtual machine.
In this article, we will discuss how to investigate and resolve this issue.
What to Check?
When using JRockit we have to make a hugetblfs file system available in the directory /mnt/hugepages. Since the message says that it cannot open temporary file /mnt/hugepages/jrock8SadIG, the first thing to check is if that directory was mounted (note that it was mounted before system maintenance).
$ mount -l
nodev on /mnt/hugepages type hugetlbfs (rw)
As shown above, /mnt/hugepages directory was mounted. The next thing to check is why JRockit cannot open temporary file in that directory. Could it be privilege?
As described in , to make the /mnt/hugepages directory accessible for the oracle user, you need to do:
- chmod -R 777 /mnt/hugepages
It turns out that it was the culprit. After issuing the above command, JRockit was able to create Java virtual machine.