I have an application that uses hugepage and the application suddenly crashed due to some bug. After crashing, since the application does not release the hugepage properly, the free hugepage number is not increased in sys filesystem.
$ sudo cat /sys/kernel/mm/hugepages/hugepages-2048kB/free_hugepages
0
$ sudo cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
1024
Is there a way to release the hugepages by force?
Open the /etc/sysctl. conf file with root permissions and add the line to it manually. Reboot for these changes to take effect. Once again, check your system's allocation of huge pages in the /proc/meminfo virtual file.
Sometimes need to check all directory that hugetlbfs has been mounted. So,
find mounted directory by command mount | grep huge
.
check every directory except especially /dev/hugepages
.
delete all 2M-sized files. (2M is the size of hugepage)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With