[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] Re: [Axiom-developer] Re: counting allocated bytes
From: |
Camm Maguire |
Subject: |
[Gcl-devel] Re: [Axiom-developer] Re: counting allocated bytes |
Date: |
11 Jul 2007 21:58:40 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
Greetings!
Stephen Wilson <address@hidden> writes:
> Hi Gregory,
>
> Gregory Vanuxem <address@hidden> writes:
>
> > Hello Stephen and Camm,
> >
> > I'm particularly interested by this addition. Can it be considered as
> > comparable to get-byte-consed in SBCL or CMUCL ?
>
> I do not belive so. IIRC get-bytes-consed returns an increasing
> sequence of integers, effectively counting the number of allocations
> performed.
>
> I was actually aiming for somthing similar, but due to my
> inexperience with GCL's internals I clearly got something wrong. I
> was using si::allocated as a guide. The sixth value is the number of
> uses of the given type. Compare the following:
>
> >(si:allocated 'cons)
>
> 204399
> 819
> 819
> 512
> 0
> 4503032
>
> >(si:total-bytes-allocated)
>
> 3296240
>
> >(defvar *c* (make-list 10000))
>
> *C*
>
> >(si:allocated 'cons)
>
> 194336
> 819
> 819
> 512
> 0
> 4513095
>
> >(si:total-bytes-allocated)
>
> 3377336
>
> >(setq *c* nil)
>
> NIL
>
> >(gbc t)
>
> T
>
> >(si:allocated 'cons)
>
> 204527
> 819
> 819
> 512
> 0
> 4513143
>
> >(si:total-bytes-allocated)
>
> 3293360
>
>
> Notice how si::allocated is returning an increasing integer sequence
> in its sixth value, whereas total-bytes-allocated is, as Camm
> mentioned, a report commensurate with (room).
>
>
> Camm, is it possible that tm_nused is providing the type of
> information necessary to get an accurate picture of how much a
> function is consing, predictably increasing even amidst gc's?
>
Yes it appears so. See also si::reset-number-used. I was confused as
it would appear the proper variable name is tm_totalloc or somesuch.
Take care,
> Thanks,
> Steve
>
>
>
>
--
Camm Maguire address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah