From: Han-Wen Nienhuys <hanwen@xs4all.nl>
To: guile-devel@gnu.org
Subject: Re: advice on reducing C stack frame size?
Date: Sat, 13 Sep 2008 15:48:37 -0300 [thread overview]
Message-ID: <gah20r$p48$1@ger.gmane.org> (raw)
In-Reply-To: <m34p4kx9w5.fsf@pobox.com>
Andy Wingo escreveu:
> Hi,
>
> With a local patch, it seems that my C stack frames are getting large
> enough to start hitting the stack overflow checks.
>
> (In the future this won't be a terrible problem, as you won't be
> recursively calling the evaluator the the vm then the evaluator etc too
> much, but while we still have a fair amount of code being interpreted,
> it is important.)
>
> So for example, just sitting at the repl, we have:
>
> frame (I think). It is about 20 kilobytes!!! In contrast, a deval frame
> appears to be less, but still excessive:
>
> #19 0x0014b076 in deval (x=0xb7f3a478, env=0xb7ee2560) at eval.i.c:358
> 358 (void) EVAL (form, env);
> (gdb)
> #20 0x0014e72e in scm_dapply (proc=0xb7f3a6d0, arg1=<value optimized out>, args=0xb7ee25d0) at eval.i.c:1858
> 1858 RETURN (EVALCAR (proc, args));
> (gdb) p 0x0014e72e - 0x0014b076
> $5 = 14008
>
> This is with gcc 4.3.0 20080428 (Red Hat 4.3.0-8).
>
> My question is: what should I do about this? Wait for the runtime tuning
> patches to land in master and then merge them? Assume that over time, I
This looks like a bug or an oversight. - 14k is about 3500 SCM values; we surely
don't have that many local variables, so it looks as if there might be some
macro that expands into a local array. I'd have a look at the addresses of the
different local variables to see where all that memory is going. Also, look at
the preprocessed source and scan for array variables.
--
Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen
next prev parent reply other threads:[~2008-09-13 18:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-13 16:56 advice on reducing C stack frame size? Andy Wingo
2008-09-13 18:48 ` Han-Wen Nienhuys [this message]
2008-09-14 16:46 ` Neil Jerram
2008-09-16 5:27 ` Ken Raeburn
2008-09-16 17:57 ` Andy Wingo
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/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='gah20r$p48$1@ger.gmane.org' \
--to=hanwen@xs4all.nl \
--cc=guile-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.
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).