Re: 'disposable' dirty pages [was: Out Of Memory in v. 2.1]

MOLNAR Ingo (mingo@chiara.csoma.elte.hu)
Thu, 8 Oct 1998 14:00:53 +0200 (CEST)


On Thu, 8 Oct 1998, Chris Wedgwood wrote:

> > Hmm, I'm wondering. I haev this application, it allocates 10
> > blocks each 1 megs in size. Then I free() 5 of those blocks, but
> > the program is still eating 10 megs of memory.
> >
> > Is this right?
>
> Using the `normal' libc malloc - yes.
>
> There are other mallocs out there which try to return the memory to
> the kernel though.

There is a _reason_ why malloc doesnt return pages immediately. It's
performance. There is a reason why X caches pixmaps. It's performance. So
sure we could drop all these features but thats not the point. The point
is to have good performance when everything is OK, and to still have the
option of immediately disposing pages when (say accidentally) memory went
low and the system got into an impossible situation. It's an additional
mechanizm.

portability is not an issue, we controll all the platforms and libc too.
It might be hard to implement it, but thats not the question. The question
is, how much memory will this free up, and how hard would it be to _use_
this in applications.

-- mingo

-
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/