Closed matsuoka-601 closed 1 year ago
Hello.
This link says that Huge Pages feature is available, so I submitted the code below. But it returns Error: Exit with code 1: mmap. Any advice on how to use Huge Pages feature? Thanks in advance.
Error: Exit with code 1: mmap
#include <iostream> #include <sys/mman.h> int main() { void* ptr = mmap(0, 10, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB, -1, 0); if (ptr == MAP_FAILED) { std::cerr << "mmap"; exit(1); } return 0; }
Try to use the madvise function.
madvise
That worked. Thank you!
Hello.
This link says that Huge Pages feature is available, so I submitted the code below. But it returns
Error: Exit with code 1: mmap
. Any advice on how to use Huge Pages feature? Thanks in advance.