[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cell heap usage in 1.8 vs 1.6
From: |
Ludovic Courtès |
Subject: |
Re: cell heap usage in 1.8 vs 1.6 |
Date: |
Mon, 08 Oct 2007 16:00:30 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Hi,
Kevin Ryde <address@hidden> writes:
> 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.
OK, I *think* I hit it with a long-running program with HEAD (this has
become visible now that the thing has been running for more than 72
hours...).
> (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))))
Note that `count-alive' returns a number of objects, while `total-heap'
(which really is "total *cell* heap") returns a number of bytes, right?
Thus, the result of `count-alive' should be multiplied by 8 (regular
cells) or 16 (double cells).
Nevertheless, even when multiplying `count-alive' by 16, I get a
`total-heap' an order of magnitude larger, which seems to confirm your
hypothesis (that more heap is being allocated despite the availability
of free cells).
To be continued...
Ludo'.
- Re: cell heap usage in 1.8 vs 1.6,
Ludovic Courtès <=