can only allocate ~404 GB on a 512 GB machine ?

Martin Vogt martin.vogt@itwm.fraunhofer.de
Thu Mar 4 10:28:00 GMT 2010


Hello list,

I have here a small machine with 512GB RAM and it seems
to me that I hit some boundary when I allocate eg: 450GB.

This is my example program:

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>

int main(int argn, char** argc) {
    long meg=1024*1024;
    long gig=meg*1024;
    long size=gig*403;
    char* dest;

    printf("size:%ld \n",size);
    printf("size2:%ld \n",SIZE_MAX);
    dest=malloc(size);
    printf("doing memset:%p\n",dest);
    memset(dest,0,size);
}


I can allocate 400GB, but not 405GB and its somehow related to the
SIZE_MAX definition.

I dont know if its a kernel boundary or a glibc boundary.
(kernel is 2.6.33.5, glibc: 2.9-13.2 on opensuse 11.1)

Is there a way to increase this?

regards,

Martin




More information about the Libc-help mailing list