httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sascha Schumann <sas...@apache.org>
Subject Re: leak in APR
Date Thu, 12 Sep 2002 22:35:19 GMT
On Thu, 12 Sep 2002, Aaron Bannert wrote:

> On Thu, Sep 12, 2002 at 04:26:02PM -0600, Jean-Jacques Clar wrote:
> > Why will I wouldn't see my allocated memory decrease if it has been
> > freed?
>
> That's just how unix works. When malloc() needs more memory it calls
> brk or sbrk to move the heap marker up and to map a new page. There's
> no way to move that thing back down, so the output of top or ps can
> always increase.

    Incorrect, you can pass negative values to sbrk (malloc
    implementations use this seldomly) or allocators call munmap
    to give pages back to the operating system.  Either way, it
    is possible that memory usage decreases.

    - Sascha


Mime
View raw message