by api · 13y ago · 0 comments
Most of the edge cases you do encounter are due to poorly-written software. The most common thing is server software that depends on Linux's default overcommit behavior and malloc() never failing and then uses that to try to badly implement a memory-sensitive cache in competition with the kernel. Containers change overcommit behavior and malloc() CAN fail, so such software will eat all the memory in a container and barf. But there are hacks to get around this, and it's mostly an issue with POS rube goldberg machine web stacks like Apache/mod_php.
I've been following LXC for a while and see that some people are now using it in production. Once Linux has a main-line kernel container solution I think you'll see it used quite a bit more. Eventually the developers of crappy server code will be forced to fix their code to behave properly.
It's a common technique used by a lot of virtual machines and memory management code to get a large contiguous region of address space to work with (most JVMs work this way, SBCL does too). I'm not exactly sure why Xen can handle overcommit fine and Virtuozzo can't, the latter does need a custom kernel so in principle they have access to all the low-level virtual memory stuff.