i'm trying run a simple malloc program to see whether my hugepage environment has been properly setup. the libhugetlbfs is installed in the default system directory only /usr/local. OS is RHEL 6.7. I checked that the libhugetlbfs.so is ther in /usr/lib64 folder. When i run i code with
HUGETLB_MORECORE=yes LD_PRELOAD=libhugetlbfs.so
the code
PHP Code:
#include<stdio.h>
#include<stdlib.h>
int main()
{
double *x;
int y,i;
y = 15000000;
x = (double *)malloc(y*sizeof(double));
if (x != NULL)
{
printf("\nmalloc successful\n");
}
else
{
printf("malloc unsuccesfull");
}
}
output gives
PHP Code:
ERROR: ld.so: object 'libhugetlbfs.so' from LD_PRELOAD cannot be preloaded: ignored.
malloc successful
its clear that the malloc dint happen using hugepage. I checked all environment variables.. not able to find problem.. any help???