[plug] USB drive mounting problems

Cameron Patrick cameron at patrick.wattle.id.au
Wed Jun 1 19:03:09 WST 2005


Daniel J. Axtens wrote:

> OT: Just for laughes/cringes, here is why you don't open a 200+mb
> image file with unsaved homework in the background: (and 256 megs of
> memory!)
> 
> Out of Memory: Killed process 3887 (eog).

Ahh, we love overcommit in Linux's VM system :P  [1]

This is also one of the reasons why having lots of swap is nice
(despite what some people will tell you), even on modern hardware with
gobs of RAM.

Cameron.

[1] For those unaware of how this works: on a Linux system, malloc()
will never fail (until a process runs out of virtual address space -
around the 3GB mark on a 32-bit machine); i.e. it will overcommit
itself, allowing processes to allocate more storage than physically
exist on the machine.

Actual system memory will only be allocated to it when it actually
starts to write to the the pages it had previously requested.  If at
this point it turns out that all RAM and swap has been used, the
kernel will pick a process and kill it, freeing up some memory.
Depending on the kernel version, this will either be picked at random
(new kernels), or the oldest process that's using lots of memory (for
some heuristic values of "old" and "lots" - older kernels).  Lots of
fun.




More information about the plug mailing list