[prev in list] [next in list] [prev in thread] [next in thread]
List: beowulf
Subject: Re: [Beowulf] 8GB memeory limit?
From: Roland Krause <rokrau () yahoo ! com>
Date: 2007-07-11 16:40:03
Message-ID: 136443.72286.qm () web81101 ! mail ! mud ! yahoo ! com
[Download RAW message or body]
Martin,
your problem, or observation, is due to a change in the way the kernel
and the glibc facilitate the allocation of memory.
The background of this is explained very well in this earlier post
http://www.mail-archive.com/beowulf%40beowulf.org/msg03723.html
and that's also where I learned about it, so all I will say here is
that the change that allows you to allocate your entire memory using
mmap occurred in kernel 2.6.9.
Best regards,
Roland
--- Martin Siegert <siegert@sfu.ca> wrote:
> 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
>
_______________________________________________
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