Hi all,
I am using Racket v7.3, Linux x86_64 version.
I want to allocate large (tens of gigabytes) chunks of memory with Racket's malloc and use them for some BLAS/LAPACK routines.
The downloaded version of Racket lets me allocate only 2^31 "atomic" bytes.
2^31+1 bytes produce an "out of memory" error, even though I still have plenty of memory left (much more than requested 2GB) on my machine.
In raw mode, I can go to 2^33 bytes, but not 2^34. My machine has 16GB RAM with swap disabled.
Is that a bug or is the amount of allocated atomic memory limited to 2^31 bytes?
Here is the code to reproduce the problem:
(require ffi/unsafe)
(malloc (expt 2 31) _uint8 'atomic) ; => #<cpointer>
(malloc (add1 (expt 2 31)) _uint8 'atomic) ; => out of memory
(define mem (malloc (expt 2 33) _uint8 'raw)) ; => #<cpointer>
(memset mem 0 #x00 (expt 2 33) _uint8) ; ok
--Peter