Re: mmap, the language go, problems with the linux kernel

From: Florian Weimer
Date: Sat Feb 12 2011 - 09:50:23 EST


* Alan Cox:

> Linux implements virtual address space limits, and enforces them. The go
> language stuff wants to allocate huge amounts of virtual space so you
> need to tell the OS you want to allow it to do crazy stuff, which you can
> do so. But virtual address space is not free - it has to be tracked and
> if the application suddenely tries to fill all of it what will happen ?
>
> You'll hit problems if the kernel is running with vm overcommit disabled
> (as well configured servers do),

The odd thing is that prot==0 does *not* count against the
vm.overcommit_memory=2 limit, only against ulimit -v. The limit is
only enforced for the parts on which mprotect is called. I think this
should really be part of the public API (I'm not sure if it is right
now, it could well be an accident), to avoid the problems you
describe.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/