why ubuntu LTS installs all in a single partition?
Colin Law
clanlaw at googlemail.com
Sun Aug 4 16:33:47 UTC 2013
On 4 August 2013 00:14, Christofer C. Bell <christofer.c.bell at gmail.com> wrote:
> [snip]
> I'm not sure under what circumstances one would consider 2GB to be a lot of
> swap. I would encourage you to look into how Linux manages memory.
> Specifically vm.overcommit_memory and vm.overcommit_ratio. The purpose of
> having 2GB of swap is to give your system some buffer virtual memory so real
> processes that end up requesting more physical RAM than you have available,
> yet will not use it, will still be able to start.
>
> For example, let's say you have 8GB of RAM in your system. Currently, 6GB
> of RAM are in use (leaving 2GB free). You want to start a process that will
> use no more than 1GB of physical RAM when running, but will request 3GB of
> memory for itself, exceeding the availability of physical RAM by 1GB.
> Without swap, this program will not start, and the kernel will give you an
> insufficient memory error (ENOMEM). With a 2GB buffer provided by swap (so
> the system's total virtual memory size is 10GB), this program will be able
> to request 3GB of RAM (as 4GB are available), be started, and happily use
> the 1GB of RAM it really needs.
I am not entirely convinced by this argument. The argument explains
how, if I had 8GB of RAM with 6GB in use, then I should allocate 2GB
swap so that I can start a process that initially asks for 3GB, even
though it will not in practice use it all. If, however, I typically
only have 2GB in use then the argument falls down as there is plenty
of room for the process to start without swap.
In my experience, provided the machine has enough RAM, the most common
case where swap starts being used is when a process runs out of
control and starts consuming more and more memory. Then swapping
starts and the result is that the whole machine effectively grinds to
a halt thrashing the disc until eventually it runs out of swap also.
All that the swap space does is make the machine effectively unusable
for the period until it runs out of swap. It would often be better
for it just to fail immediately it runs out of real RAM.
Colin
More information about the ubuntu-users
mailing list