> And on linux it will always succeed and be killed by oom later. I suspect you forgot /proc/sys/vm/overcommit_memory=2 (i.e. account always mode). Moreover, the default mode (/proc/sys/vm/overcommit_memory=1, ie account guess mode) also may return failure if you try obvious big size allocation.
thank you.