Actually, Linux will allow to you allocate almost infinite amounts of
memory, so long as you only allocate it in chunks smaller than
physical+swap:
- If you're on a machine with swap, when you get round to using it (or
use mlockall) things swap like mad and eventually block (or hard lock,
which my 2.3.39 machine does).
- On a machine without swap, when you get round to using it, it'll
SIGBUS. Or another random process that schedules will SIGBUS as its
libraries or executable gets page faulted, and can't page.
In neither case did mmap or brk return ENOMEM. The only notification the
process got of running out of memory was being killed.
It seems it is possible to keep track of memory such that any successful
mmap will always be pageable - keep track of allocated pages which are
pending paging and subtract that from free_pages in vm_enough_memory().
Still, this is getting back to a short thread I started long ago - if I
have some spare time I'll try implementing it.
-- John Ripley, empeg Ltd. http://www.empeg.com- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/