On 15/07/16 13:23, Neeraj Sharma wrote:
As anticipated Erlang
VM is requesting for larger chunk 1GB of memory while VM is running
256MB which surprisingly goes into an infinite loop within rumprun.
I have raised an issue https://github.com/rumpkernel/rumprun/issues/81
to track the same and will be great if it's looked at.
ic. Well, that doesn't really seem too hard to fix, especially on the
Erlang VM side. It's a classic case of "we're running on top of virtual
memory, so let's just allocate silly amounts".
For Rumprun, it's quasi-easy to fix. It's actually quite hard to say
when a memory allocation really can never succeed -- the classic CANFAIL
memory allocation problem. It's clear that you can never allocate a
wired memory chunk larger than the amount of physical memory. But how
much smaller must you go before you've stepped out of the "abandon all
hope" place?
Since callers of rump_hypermalloc() aren't stupid (they're kernel code),
I'd say that the right fix is to call hypermalloc with waitok = false
and put some sort of uvm_wait() logic into mmapmem_alloc().