unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Daniel Colascione <dancol@dancol.org>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: (heap 1024 82721 1933216)
Date: Sat, 18 Jan 2014 21:53:26 -0500	[thread overview]
Message-ID: <jwvzjmsg023.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <52DA8412.2080009@dancol.org> (Daniel Colascione's message of "Sat, 18 Jan 2014 05:39:30 -0800")

> value. dlmalloc's free memory retention seems a bit severe here.

There are several levels at which the memory is "returned to the other level":
- if a single cons cell is in use in a "cons cell block", that block
  can't be freed.
- those blocks are themselves allocated in groups of 16 IIRC, so those
  groups can only be freed once all 16 of them have been freed at the
  previous level.
- malloc/free can itself decide to keep those "freed" blocks for later
  use, or to return them to the OS.  At this level, the behavior depends
  on the malloc library in use, which depends on the OS.
  IIUC there are malloc libraries in use which never return memory back
  to the OS.

> Are we just badly fragmenting the heap?

Could be.  For an Emacs that grew to 6GB, I don't find it worrisome
if it doesn't shrink back below 2GB.  I'm much more worried about: how
on earth did it grow to 6GB?


        Stefan



  parent reply	other threads:[~2014-01-19  2:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-18 13:39 (heap 1024 82721 1933216) Daniel Colascione
2014-01-18 13:50 ` Eli Zaretskii
2014-01-18 13:51   ` Daniel Colascione
2014-01-18 14:07     ` Eli Zaretskii
2014-01-18 14:12       ` Daniel Colascione
2014-01-18 17:17         ` Eli Zaretskii
2014-01-18 14:15       ` David Kastrup
2014-01-18 17:19         ` Eli Zaretskii
2014-01-19  2:53 ` Stefan Monnier [this message]
2014-01-19  3:31   ` Daniel Colascione
2014-01-19  4:19     ` Stefan Monnier
2014-01-19  4:24       ` Daniel Colascione
2014-01-19 14:37         ` Stefan Monnier
2014-01-19 15:45     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvzjmsg023.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).