why ubuntu LTS installs all in a single partition?

Paul Smith paul at mad-scientist.net
Sun Aug 4 21:56:04 UTC 2013


On Sun, 2013-08-04 at 16:29 -0500, Christofer C. Bell wrote:
> If you have an 8GB machine and only use 2GB of RAM routinely, your use
> of the machine is very inefficient. :-)  That said, your swap *is*
> being used all the time for memory allocation calculations by the
> kernel.  The swap *itself* isn't visibly touched, but the presence of
> the virtual memory it provides is used every time the malloc() system
> call is made by a process.

I'm not sure this is true, on Linux.  Can you explain what you mean by
"request 3GB of memory"?  Request in what way?  You mean using
brk()/sbrk()?  Or some kind of mmap() call?  Or something else?

Many versions of UNIX do not allow overcommitting memory, but Linux
_does_ allow overcommit and has it enabled by default.  I believe this
is true on Ubuntu as well.

Overcommit allows system calls that request lots of memory (more memory
than is available) to succeed, and it's only when the memory is actually
USED (written to) that the kernel attempts to obtain it.  If there's no
memory at that time then the program dies an ignoble death.

Overcommit is controversial because without it, if you request more
memory than you have your request function (e.g., malloc()) will return
a failure and your program can try to deal with it in a graceful way.
With overcommit, the request function succeeds and then some later code
(probably in user-space!) that tries to write to the memory, such as
memcpy() or similar, will cause the program to fail at a random time in
a decidedly non-graceful manner.

However, because of the POSIX standard way of creating processes
(fork/exec), overcommit is extremely helpful "in real life".  Without
overcommit you have other failure cases.  Larger servers with required
SLAs, or that run certain kinds of software, may well want to disable
overcommit, but it's very helpful for a desktop or even small server
system.

If overcommit is enabled, swap space is not so important.  I would
definitely not argue with anyone that wanted a gig or two, or at the
outside 4, of swap (although you shouldn't have more than that, IMO: the
old rule of "1/2 memory" is just silly for today's 8G, 16G, or larger
RAM and lots of swap can cause other problems).  But you can get by
without it[1], and still make full use of your system.


[1] Unless, as previously pointed out, you want to do hibernation.





More information about the ubuntu-users mailing list