allocateHeap caps the heap at 1GB on every target. With -gc=conservative or -gc=precise, a single allocation approaching 1GB fails with out of memory no matter how much system RAM is free. The case that hit this was a 1GiB scrypt key derivation buffer (N=1<<20, r=8) on a machine with 16GB free.
On 64-bit targets the reservation can be much larger. An mmap only reserves address space, and pages cost physical memory when first touched. The growHeap comment already points this way. 32-bit targets would keep the 1GB cap.
PR #5644 reserves 16GB of address space on 64-bit unix.
allocateHeap caps the heap at 1GB on every target. With -gc=conservative or -gc=precise, a single allocation approaching 1GB fails with out of memory no matter how much system RAM is free. The case that hit this was a 1GiB scrypt key derivation buffer (N=1<<20, r=8) on a machine with 16GB free.
On 64-bit targets the reservation can be much larger. An mmap only reserves address space, and pages cost physical memory when first touched. The growHeap comment already points this way. 32-bit targets would keep the 1GB cap.
PR #5644 reserves 16GB of address space on 64-bit unix.