Walt Mankowski on 24 Nov 2003 09:57:02 -0500


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

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


On Sat, Nov 22, 2003 at 01:24:45AM -0500, Walt Mankowski wrote:
> On Fri, Nov 21, 2003 at 06:07:36PM -0500, Tobias DiPasquale wrote:
> > On Fri, 2003-11-21 at 15:00, Walt Mankowski wrote:
> > > That happens 4 times, and then it aborts.
> > > 
> > > Anyone have any idea why I can't get to all that swap space?
> > 
> > The process is being killed by the OOM (out-of-memory) killer. When
> > physical memory gets tight (since the kernel memory is not pageable) and
> > the kernel cannot allocate memory, it will run the OOM killer to free up
> > some memory. It kills the process currently running, which is invariably
> > your matrix-manipulation program. You can't get into all that swap
> > because the kernel runs out of memory before you get to use the
> > remaining swap. Move to 2.6 or 2.4.23pre and you will not have that
> > issue (the OOM killer is removed in these kernels).
> 
> http://linux-mm.org/docs/oom-killer.shtml says this happens when
> *virtual* memory gets tight.  And I've got a TON of virtual memory.
> And even so, why doesn't it just swap out some other part of my
> process?

I realized when I got back into the office today that the issue isn't
so much having the OOM killer kill my process as it is running out of
memory in the first place.  By the time it aborts, it's already tried
to create 4 large matrices and gotten ENOMEM each time.  Even if it
continued processing, any results this program would generate after
that would be invalid.

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?

Walt

Attachment: pgpvp275swfk3.pgp
Description: PGP signature