[prev in list] [next in list] [prev in thread] [next in thread] 

List:       beowulf
Subject:    [Beowulf] 8GB memeory limit?
From:       Martin Siegert <siegert () sfu ! ca>
Date:       2007-07-11 0:11:50
Message-ID: 20070711001150.GB616 () stikine ! ucs ! sfu ! ca
[Download RAW message or body]

Hi,

I am running into a bizarre memory issue: I do not appear to be
able to allocate 8GB of memory into a single array:

===<int_malloc.c>================================================
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]){
long int i, n;
long int *m;

   n = 1024*1024*1024*sizeof(long int);
   for (i = 1; i <= n; i*=2) {
      m = (long *) malloc(i);
      if (m == NULL) {
         fprintf(stderr, "allocation of %li bytes failed.\n", i);
         exit(-1);
      }
      free(m);
   }
}
===</int_malloc>=================================================

# gcc -m64 int_malloc.c
# ./a.out
allocation of 8589934592 bytes failed.

This is with a 2.6.5 kernel (SLES 9).
If I compile the same program under kernel 2.6.16.27 (openSuSE 10.2),
the program completes without problem.

Under either OS I can allocate, e.g., 5 arrays of 4GB each within the
same program without problem.

Where does this limit of 8GB for a single array come from?
Is it in the kernel? If yes, can it be changed, e.g., through a sysctl?
Which one?

Cheers,
Martin

-- 
Martin Siegert
Head, HPC@SFU
WestGrid Site Lead
Academic Computing Services                phone: (604) 291-4691
Simon Fraser University                    fax:   (604) 291-4242
Burnaby, British Columbia                  email: siegert@sfu.ca
Canada  V5A 1S6
_______________________________________________
Beowulf mailing list, Beowulf@beowulf.org
To change your subscription (digest mode or unsubscribe) visit \
http://www.beowulf.org/mailman/listinfo/beowulf


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic