unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
To: guile-devel@gnu.org
Subject: cell heap usage in 1.8 vs 1.6
Date: Fri, 17 Aug 2007 10:28:35 +1000	[thread overview]
Message-ID: <87ir7ff1ho.fsf@zip.com.au> (raw)

I'm having trouble in my charting program with the amount of heap space
allocated for cells in 1.8.  It ends up allocating more and more heap
(as reported by gc-stats 'cell-heap-segments and confirmed by
mallinfo()), apparently without bound.  I've got between 150k and 200k
objects according to gc-live-object-stats, which should be about 5Mb of
cells, but the heap keeps growing to as much as 60Mb.

The same code seems ok in 1.6, it lives happily in about 5Mb of heap,
though it does seem to do a few more gc's than 1.8.  A backport of
gc-live-object-stats to 1.6 says the objects in use are about the same
there.

I stuck in lots of printfs, which haven't told me much so far, except
that the "collected" counts seem to be lower than I'd expect, and cause
min_yield to be increased, and the heap then added to (every few gc's).

Should the collected counts end up basically as "heapsize - liveobjects"
every time?  They seem to be smaller than that, but I don't know where
to look for how or why.  scm_i_sweep_segment() looks slightly doubtful.
Does it deliberately not count the balance of a lazy sweep towards the
collected counts?  I wondered if a gc is provoked by the double cells
being exhausted but only a little of the single cells having been
collected, leaving a small collected count in the latter (or vice
versa).

Alas I don't have a simple program to provoke the problem.  Perhaps some
other big or long run program users could look at their heap consumption
vs live objects, to see if it's just me.

(define (total-heap)
  (apply + (map (lambda (elem)
                  (abs (- (cdr elem) (car elem))))
                (assoc-ref (gc-stats) 'cell-heap-segments))))

(define (count-alive)
  (apply + (map cdr (gc-live-object-stats))))


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


             reply	other threads:[~2007-08-17  0:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-17  0:28 Kevin Ryde [this message]
2007-08-20 22:16 ` cell heap usage in 1.8 vs 1.6 Ludovic Courtès
2007-08-23  0:58   ` Kevin Ryde
2007-08-23  8:37     ` Ludovic Courtès
     [not found]       ` <878x7vb64r.fsf@zip.com.au>
2007-08-29 11:36         ` Ludovic Courtès
2007-10-08 14:00 ` Ludovic Courtès
2007-10-10  9:30 ` Ludovic Courtès
2007-10-12 10:08   ` Ludovic Courtès

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=87ir7ff1ho.fsf@zip.com.au \
    --to=user42@zip.com.au \
    --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).