unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
Cc: emacs-devel@gnu.org
Subject: Re: Debugging memory leaks/stale references
Date: Tue, 21 Sep 2004 23:01:50 +0200	[thread overview]
Message-ID: <87y8j3fi9t.fsf@deneb.enyo.de> (raw)
In-Reply-To: <jwvfz5b76tj.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Tue, 21 Sep 2004 15:57:10 -0400")

* Stefan Monnier:

>> Is it possible to dump all reachable Lisp objects to a file, in the
>> format that is returned by princ?
>
> Not that I know.
>
>> I could run diff(1) on two versions of the file, and this might reveal
>> which objects are leaking (or held by stale references).
>
> That's an interesting idea.
> But one of the problems is that `princ' is not enough.  Starting from the
> root set (i.e. the stack, and the global vars), princ would fail to print
> a lot of info because buffers are just printed #<buffer foo> without
> exposing its contents.

Hmm, I don't think so.  You'd have to mimic a GC traversal, and GC
does descend into buffer objects.

> Indeed.  One thing I was thinking about is a function
> `count-exclusive-children' which would take an object X as a parameter
> (could be the obarray, a buffer, a symbol, ...) and would return the number
> of objects that would die if X died.

I'm not sure about the usefulness of this function.  If data
structures are cyclic, it might not yield any actionable data at all.

> I think it's indeed the same with CVS, based on reports we got here not that
> long ago from Kai and others.

Indeed.  But at least my Emacs doesn't crash at the end of the day.

>> It's probably a Gnus bug, but you never know.)
>
> It might also be in Emacs or in an interaction between the two.

Or even with GNU libc's malloc().  The Emacs allocator disables
allocation using mmap() in some cases, and the corresponding part of
the libc allocator might have been subject to bit rot lately.

      reply	other threads:[~2004-09-21 21:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-21 17:38 Debugging memory leaks/stale references Florian Weimer
2004-09-21 19:49 ` Simon Josefsson
2004-09-27 19:40   ` Florian Weimer
2004-09-27 19:52     ` Stefan Monnier
2004-09-27 20:36       ` Florian Weimer
2004-09-27 20:49         ` Stefan Monnier
2004-09-27 20:48       ` Simon Josefsson
2004-09-28 15:20     ` Richard Stallman
2004-09-28 21:00       ` Florian Weimer
2004-09-28 21:51         ` Florian Weimer
2004-09-29 16:39         ` Richard Stallman
2004-09-29 23:51         ` Kenichi Handa
2004-09-28 21:40       ` Kim F. Storm
2004-09-21 19:57 ` Stefan Monnier
2004-09-21 21:01   ` Florian Weimer [this message]

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=87y8j3fi9t.fsf@deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --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).