Re: Out Of Memory in v. 2.1

Ion Badulescu (ionut@moisil.cs.columbia.edu)
Sun, 4 Oct 1998 23:05:25 -0400


On 4 Oct 1998 15:05:32 -0700, david parsons wrote:
> In article <linux.kernel.m0zPwOX-000aNdC@the-village.bc.nu>,
> Alan Cox <linux-kernel@vger.rutgers.edu> wrote:
> [On overcommit]
>
> [someone else wrote]
>
>>> So, for a solution, let's do what all programs know how to deal with. Return
>>> nulls instead of overallocating. No processes need to get killed, and the
>>> system won't get deadlocked by overallocation.
>
>>And to boot a machine with 512Mb of RAM you'll need at least 600Mb or
>>so of swap file.
>
> That's one thing I've always wondered about. Why not have the system
> keep track of total memory instead of wanting to mirror memory onto
> swap? It seems to me that if you have 512mb of core and 128mb of
> swap that you've got 640mb of memory and you should be able to do
> allocations against that, since either a page will be in core or
> on the swap device.

Or on both.

Consider what happens when a page in the data segment is paged out and then
paged back in. If the kernel removes the swap allocation for that page, next
time it wants to page it out it has to write it to the disk no matter what.
On the other hand, if the swap allocation is preserved and the page hasn't
been modified since it was paged in, it can be reclaimed with zero disk activity
because a copy of it is already on the disk.

Ion

-- 
  It is better to keep your mouth shut and be thought a fool,
            than to open it and remove all doubt.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/