unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 9221@debbugs.gnu.org
Subject: bug#9221: Memory leak
Date: Tue, 02 Aug 2011 00:39:10 -0400	[thread overview]
Message-ID: <E1Qo6l4-0003Xx-Jd@fencepost.gnu.org> (raw)
In-Reply-To: <jwvtya0pn55.fsf@iro.umontreal.ca> (message from Stefan Monnier on Mon, 01 Aug 2011 22:23:18 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Mon, 01 Aug 2011 22:23:18 -0400
> 
> I'm seeing some weird behavior linked to insane memory consumption.
> E.g. my Gnus session tends to grow to more than 2GB and then become
> unusage and unkillable (or close enough: in D state, "kill -9" isn't
> enough to make it stop use CPU, tho I guess that CPU use is really due
> to something like the OS being in the process of dumping the core file,
> tho I don't see any left over core files).

Does anyone else see similar memory footprint growth?

> I did manage to attach to it and get a few backtraces (with
> a breakpoint on mmap) before it was too late, and bidi_shelve_cache
> showed up in most of the backtraces (like 5 out of 8, maybe): not
> a strong indictment, but at least a lead worth following until I get
> more data.

bidi_shelve_cache is used extensively during redisplay, and it does
allocate memory (which should be almost immediately freed by its
companion bidi_unshelve_cache, or by an explicit xfree call in a few
places).  So the fact that you saw it on the callstack of a breakpoint
in mmap is what I'd expect, not really an evidence of a leak.  To see
if the leak is really due to bidi, run a session with
bidi-display-reordering turned off, and see if there's any change.
Although, AFAIR, some calls to bidi_shelve_cache are not conditioned
on bidi.

FWIW, I'm running a session continuously for several days since the
last rebuild, and don't see any unusual footprint, let alone one that
grows without limits.  But that's a with a code base that is slightly
different from the trunk, and I don't use Gnus, so perhaps some change
done lately (including in bidi.c) is responsible.  What trunk revision
are you running.

If we cannot exclude bidi_shelve_cache from the list of suspects, I
could add debugging code that monitored its allocations and
deallocations.  That would allow us to see if there's non-zero
balance.





  reply	other threads:[~2011-08-02  4:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02  2:23 bug#9221: Memory leak Stefan Monnier
2011-08-02  4:39 ` Eli Zaretskii [this message]
2011-08-02 11:17   ` Antoine Levitt
2011-08-02 11:37     ` Eli Zaretskii
2011-08-02 12:18       ` Antoine Levitt
2011-08-02 23:53   ` Andy Moreton
2011-08-03  3:03     ` Eli Zaretskii
2011-08-03  9:04       ` Andy Moreton
2011-08-03 14:06         ` Andy Moreton
2011-08-04 22:14           ` Andy Moreton
2011-08-04 22:33             ` Antoine Levitt
2011-08-05 11:16             ` 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=E1Qo6l4-0003Xx-Jd@fencepost.gnu.org \
    --to=eliz@gnu.org \
    --cc=9221@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).