public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "kkylheku at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug libc/1128] Malloc not trimming filled-up sbrk space causes unnecessary system call overhead
Date: Fri, 18 Jul 2008 20:07:00 -0000	[thread overview]
Message-ID: <20080718200708.10506.qmail@sourceware.org> (raw)
In-Reply-To: <20050727134634.1128.jp-www@dcs.gla.ac.uk>


------- Additional Comments From kkylheku at gmail dot com  2008-07-18 20:07 -------
(In reply to comment #2)
> I think it would not fix the following (IMHO in practice more likely) 
situation:
> 1. lot's of malloc/free from the main arena
> 2. a single sbrk(+something) call from the app

IMHO, apps that call sbrk deserve less than optimal behavior from malloc, such 
as memory not being returned when it is freed.

> 3. lot's of free() from the main arena
> -- now every free() can still incur an
> sbrk(0) call because the end of the main arena never can pass the user-
allocated
> space
> I think the proper fix would be to prevent or alleviate the sbrk(0) in every
> free(), given that sbrk(0) is very expensive (but see below).

But, seeing below, it is successfully argued that sbrk(0) is actually not 
expensive at all thanks to cashing. The remaining problem is that the freed 
memory won't be returned to the operating system.  But the application 
arguably deserves that, because it interfered with malloc by calling sbrk
(+delta).


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1128

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


  parent reply	other threads:[~2008-07-18 20:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-27 13:46 [Bug libc/1128] New: " jp-www at dcs dot gla dot ac dot uk
2008-03-28  5:55 ` [Bug libc/1128] " kkylheku at gmail dot com
2008-03-28  6:01 ` kkylheku at gmail dot com
2008-03-28 17:45 ` bugzilla1 at malloc dot de
2008-03-28 18:05 ` bugzilla1 at malloc dot de
2008-07-18 20:07 ` kkylheku at gmail dot com [this message]
2008-07-20 19:42 ` jp-www at dcs dot gla dot ac dot uk
2009-10-01 12:03 ` simberger at gmail dot com
2009-10-01 12:20 ` simberger at gmail dot com
2009-10-01 17:15 ` bugzilla1 at malloc dot de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080718200708.10506.qmail@sourceware.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).