4 ms·
> One most modern 64-bit systems, malloc will never fail anyway Except if a virtual memory resource limit is set ("help ulimit"). $ sh -c 'ulimit -S -v 1000
by pflanze 11y ago
> One most modern 64-bit systems, malloc will never fail anyway
Except if a virtual memory resource limit is set ("help ulimit").
$ sh -c 'ulimit -S -v 1000 ; perl -e 1'
Segmentation fault
$ sh -c 'ulimit -S -v 2000 ; perl -e 1'
perl: error while loading shared libraries: libm.so.6: failed to map segment from shared object: Cannot allocate memory
$ sh -c 'ulimit -S -v 20000 ; perl -e "qw{a}x100000000"'
Out of memory!