This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug malloc/15321] malloc/free can't give the memory back to kernel when main_arena is discontinous


https://sourceware.org/bugzilla/show_bug.cgi?id=15321

ma.jiang at zte dot com.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ma.jiang at zte dot com.cn

--- Comment #5 from ma.jiang at zte dot com.cn ---
(In reply to Siddhesh Poyarekar from comment #4)
> Closing as NOTABUG based on comment 3.  malloc/free indeed cannot give
> address space back to the kernel when main arena is discontinuous and that
> is expected behaviour.

Hi guys, 
  I'm porting a patch about this problem to newest glibc. I am afraid this bug
were probably more serious than discussed here.
  In short, glibc just do not free any memory in the main heap when it become
discoutinuous. As a result, a process may keep the peak physical memory usage
as long as it is alive. This is really bad as glibc are widely used in server
programs...
  This bug is not about fragmentation, but more serious. Once all memory are
freed, fragmentation will disappear and all memory could be reused again. But
if the bug occurred, no memory could be reused(by other processes) even all of
them were freed.
  In fact, fix to this bug is quite straightforward. Just port the mechanism
used by sub heaps to the main arena should  be enough. We have made such a
patch several years ago, and have applied it on production environments since
then. I'll post the patch later after I port it to the new glibc release.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]