You can use huge-pages transparently with the envar: GLIBC_TUNABLES=glibc.malloc.hugetlb=2, this should just work allocating 2MB pages by default, no preallocation required, you can also use the value to specify the size of the page (though I've only tested with =2).
There's documentation here
If that doesn't work, you can try: echo always > /sys/kernel/mm/transparent_hugepage/enabled
Which is documented here
You can use huge-pages transparently with the envar:
GLIBC_TUNABLES=glibc.malloc.hugetlb=2, this should just work allocating 2MB pages by default, no preallocation required, you can also use the value to specify the size of the page (though I've only tested with=2).There's documentation here
If that doesn't work, you can try:
echo always > /sys/kernel/mm/transparent_hugepage/enabledWhich is documented here