all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
To: Baoqiu.Cui@yahoo.com
Cc: emacs-devel@gnu.org
Subject: Re: VM crashes on big INBOX file ==> problem found!!!
Date: Sat, 27 Oct 2007 09:57:48 -0400	[thread overview]
Message-ID: <E1IlmAe-0000BJ-I0@fencepost.gnu.org> (raw)
In-Reply-To: <yoruabq6icer.fsf_-_@AFTERRDOUBT-LX.ds.corp.yahoo.com> (Baoqiu.Cui@yahoo.com)

    garbage collection is triggered and function mark_object() (in alloc.c)
    is recursively called about 29,885 times (see the backtrace info
    below)!!!  So many levels of mark_object() calls make the stack
    overflow, causing a segmentation fault.

I wonder if this indicates a bad choice of data structures.
mark_object calls itself recursively for many kinds of pointers,
but it is supposed to loop rather than recurse for cdr pointers.
This is so that long lists do not cause recursion.
Most data structures don't have a tremendous amount of nesting
in the car direction.

I wonder what sort of data structures made 29,885 recursive
calls necessary.  Perhaps we should change those data structures
or else change the garbage collector so it recurses less.

For instance, maybe a lot of this recursion goes thru symbols.  If so,
here is an idea.  Suppose that when mark_object finds a symbol which
is not yet marked, and is interned in the main obarray, it sets a bit
"needs to be marked" in the symbol.  Then increment a counter
which records how many symbols are in this state.

Then gc_sweep could end by scanning the main obarray over and over,
marking those symbols, until the counter goes to zero.

Depending on the nature of the problem, this might or might not
help much.  If the main data types involved are others,
a different solution might help.

  reply	other threads:[~2007-10-27 13:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <yoruodet2jjm.fsf@AFTERRDOUBT-LX.ds.corp.yahoo.com>
     [not found] ` <fflvjt$dcs$1@reader1.panix.com>
     [not found]   ` <yoru7ildglb3.fsf@AFTERRDOUBT-LX.ds.corp.yahoo.com>
     [not found]     ` <ffo8rl$169$1@reader1.panix.com>
     [not found]       ` <v9myu82p62.fsf@marauder.physik.uni-ulm.de>
     [not found]         ` <yorumyu8f7pt.fsf@AFTERRDOUBT-LX.ds.corp.yahoo.com>
2007-10-26  7:05           ` VM crashes on big INBOX file ==> problem found!!! Baoqiu.Cui
2007-10-27 13:57             ` Richard Stallman [this message]
2007-12-20 22:21               ` Baoqiu Cui
2007-12-21 19:49                 ` Richard Stallman
2007-10-26 15:22           ` VM crashes on big INBOX file Baoqiu.Cui

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=E1IlmAe-0000BJ-I0@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=Baoqiu.Cui@yahoo.com \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.