Tobias DiPasquale on 24 Nov 2003 13:36:02 -0500


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

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


On Mon, 2003-11-24 at 10:47, Walt Mankowski wrote:
> 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?

Ok, you piqued my curiosity on this one and I just checked it out. Its
the _process of swapping_ that's causing your process to die. During the
very long and winding call chain that emerges from sys_mmap2() (the
in-kernel function that's called when your program calls mmap2()), at
some point it attempts to swap out some pages and calls out_of_memory()
because try_to_free_pages_zone() fails to free enough pages to satisfy
the request and, thus, your process is killed. I'll bet real money on
this being the case... unfortunately, there is no way for you to trace
the kernel's execution path without recompiling. You may want to try
using a kernel without the OOM killer in it. I believe the very latest
pre-release kernels have this feature removed. Check it out and let us
know what happens.

-- 
Tobias DiPasquale, www.cbcg.net
88FA 30C9 1E63 CFE2 CBD8  37C4 DA1C E2BF 1D26 F036

Attachment: signature.asc
Description: This is a digitally signed message part