Walt Mankowski on 24 Nov 2003 10:45:03 -0500


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Why am I running out of memory?


On Mon, Nov 24, 2003 at 10:24:48AM -0500, Tobias DiPasquale wrote:
> On Mon, 2003-11-24 at 09:59, Walt Mankowski wrote:
> > I still don't understand why the kernel's running out of memory.
> > Can't a single process be larger than the amount of real memory?  Or
> > is it because I'm trying to allocate such a big chunk of memory all at
> > once?
> 
> A process can surely be larger than the amount of physical memory.
> Unfortunately, since kernel memory is not pageable, it requires physical
> memory. In certain places in the kernel, if a memory allocation fails,
> it will call the OOM killer in an attempt to free up some memory. Since
> you already have all of the physical memory on the system, this
> allocation is failing and you are getting killed since you invariably
> have the highest score (as far as the OOM killer is concerned). It has
> little to do with the amount of virtual memory on the system, and more
> to do with whether or not certain parts of the kernel can allocate
> memory when it needs it.

I'm sorry, but I'm still not seeing this.  If a process taking up too
much physical memory can cause the kernel to run out of memory for
itself, how can it ever get to be *larger* than physical memory?

Why doesn't the kernel just swap out some of my process before asking
for more memory?  Are there any techniques I can use to make sure the
kernel has enough physical memory for itself?

Walt

Attachment: pgpdJu9tc7SKb.pgp
Description: PGP signature