unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’
@ 2012-11-15  8:42 Thien-Thi Nguyen
  2013-03-05 17:52 ` Andy Wingo
  0 siblings, 1 reply; 8+ messages in thread
From: Thien-Thi Nguyen @ 2012-11-15  8:42 UTC (permalink / raw)
  To: 12892


[-- Attachment #1.1: Type: text/plain, Size: 742 bytes --]

In pre-2.x Guile, ‘gc-stats’ returns an alist w/ keys:

 gc-time-taken
 cells-allocated
 total-cells-allocated
 cell-heap-size
 bytes-malloced
 gc-malloc-threshold
 gc-times
 gc-mark-time-taken
 cells-marked
 cells-swept
 malloc-yield
 cell-yield
 protected-objects
 cell-heap-segments

In Guile 2.0.6, the keys are now:

 gc-time-taken
 heap-size
 heap-free-size
 heap-total-allocated
 heap-allocated-since-gc
 protected-objects gc-times

I think the NEWS should mention this change and the documentation should
summarize what the fields mean.  Practically speaking, i am interested
mostly in the 2.x equivalent for pre-2.x ‘bytes-malloced’, as its lack
causes Guile-SDL to fail "make check DEBUG=1":


[-- Attachment #1.2: .ttn.make-check.log.gz --]
[-- Type: application/octet-stream, Size: 5325 bytes --]

[-- Attachment #1.3: Type: text/plain, Size: 649 bytes --]


by tripping up proc:

 (define (malloced)
   ;; prudence or superstition?  you be the judge!
   (gc) (gc)
   (assq-ref (gc-stats) 'bytes-malloced))
 
in test/leak.scm.  A related issue is how the error is reported.  It
seems strange that the file is "unknown".

-- 
Thien-Thi Nguyen ..................................... GPG key: 4C807502
.                  NB: ttn at glug dot org is not me                   .
.                 (and has not been since 2007 or so)                  .
.                        ACCEPT NO SUBSTITUTES                         .
........... please send technical questions to mailing lists ...........

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’
  2012-11-15  8:42 bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’ Thien-Thi Nguyen
@ 2013-03-05 17:52 ` Andy Wingo
       [not found]   ` <87fw09oz2w.fsf@zigzag.favinet>
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2013-03-05 17:52 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: 12892

On Thu 15 Nov 2012 09:42, Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> In pre-2.x Guile, ‘gc-stats’ returns an alist w/ keys:
>
>  gc-time-taken
>  cells-allocated
>  total-cells-allocated
>  cell-heap-size
>  bytes-malloced
>  gc-malloc-threshold
>  gc-times
>  gc-mark-time-taken
>  cells-marked
>  cells-swept
>  malloc-yield
>  cell-yield
>  protected-objects
>  cell-heap-segments
>
> In Guile 2.0.6, the keys are now:
>
>  gc-time-taken
>  heap-size
>  heap-free-size
>  heap-total-allocated
>  heap-allocated-since-gc
>  protected-objects gc-times
>
> I think the NEWS should mention this change and the documentation should
> summarize what the fields mean.

The specifics of this interface were never documented, so there's no
regression.  For that reason I would not add to NEWS at this point, but
documentation would be nice.  Patches gladly accepted :)

> Practically speaking, i am interested mostly in the 2.x equivalent for
> pre-2.x ‘bytes-malloced’, as its lack causes Guile-SDL to fail "make
> check DEBUG=1":

What is the meaning of this field?

We could track total allocations registered via
scm_gc_register_allocation.

Regards,

Andy
-- 
http://wingolog.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’
       [not found]   ` <87fw09oz2w.fsf@zigzag.favinet>
@ 2013-03-06  7:00     ` Andy Wingo
       [not found]       ` <87boaxotz6.fsf@zigzag.favinet>
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2013-03-06  7:00 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: 12892

On Wed 06 Mar 2013 06:51, Thien-Thi Nguyen <ttn@gnuvola.org> writes:

>    What is the meaning of this field?
>
> It's a copy of the C global var ‘scm_mallocated’, which tracks "current
> allocation" (all malloced minus all freed).

There is no such C global var.

>    We could track total allocations registered via
>    scm_gc_register_allocation.
>
> Sounds complicated.

On the contrary, this function is called already for mallocations.

Andy
-- 
http://wingolog.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’
       [not found]       ` <87boaxotz6.fsf@zigzag.favinet>
@ 2013-03-06 16:03         ` Andy Wingo
       [not found]           ` <87y5e0nxa0.fsf@zigzag.favinet>
  2013-03-13 11:09           ` Andy Wingo
  0 siblings, 2 replies; 8+ messages in thread
From: Andy Wingo @ 2013-03-06 16:03 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: 12892

On Wed 06 Mar 2013 08:41, Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> () Andy Wingo <wingo@pobox.com>
> () Wed, 06 Mar 2013 08:00:08 +0100
>
>    On Wed 06 Mar 2013 06:51, Thien-Thi Nguyen <ttn@gnuvola.org> writes:
>
>    >    What is the meaning of this field?
>    >
>    > It's a copy of the C global var ‘scm_mallocated’, which tracks
>    > "current allocation" (all malloced minus all freed).
>
>    There is no such C global var.
>
> http://git.savannah.gnu.org/cgit/guile.git/tree/libguile/gc.c?h=ttn-back-in-the-saddle#n210            
>
> You have forgotten perhaps that we are trying to figure out how to surf
> a change between 1.8 and 2.0, and that "this field" is a 1.8 field?

1.8 is the old stable series, so it's not a great referent in the
present tense.

Anyway, Guile 2 does not track the number of bytes freed -- only the
bytes that are mallocated.

Andy
-- 
http://wingolog.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’
       [not found]           ` <87y5e0nxa0.fsf@zigzag.favinet>
@ 2013-03-07  6:53             ` Andy Wingo
       [not found]               ` <87txono0k2.fsf@zigzag.favinet>
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2013-03-07  6:53 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: 12892

On Wed 06 Mar 2013 20:28, Thien-Thi Nguyen <ttn@gnuvola.org> writes:

>    Anyway, Guile 2 does not track the number of bytes freed -- only the
>    bytes that are mallocated.
>
> OK, that's what i need to know.  I'll disable this particular test for
> Guile 2, then.  Thanks.

Cool.  I apologize if I came across as harsh.

Regards,

Andy
-- 
http://wingolog.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’
       [not found]               ` <87txono0k2.fsf@zigzag.favinet>
@ 2013-03-07 19:21                 ` Andy Wingo
  2013-03-07 20:05                   ` Thien-Thi Nguyen
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Wingo @ 2013-03-07 19:21 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: 12892

On Thu 07 Mar 2013 13:29, Thien-Thi Nguyen <ttn@gnuvola.org> writes:

> What is harsh, however, is the constant rejection by debbugs of my mail:
> <http://lists.gnu.org/archive/html/bug-guile/2013-03/threads.html>.
> Am i missing something?

I have no earthly idea why this is happening; it's certainly not
intentional.  Try mailing help-debbugs@gnu.org to get folks to grep the
logs?  If that ML is itself managed by debbugs, you could mail someone
directly I guess -- Jim Meyering perhaps?  Dunno.

Andy
-- 
http://wingolog.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’
  2013-03-07 19:21                 ` Andy Wingo
@ 2013-03-07 20:05                   ` Thien-Thi Nguyen
  0 siblings, 0 replies; 8+ messages in thread
From: Thien-Thi Nguyen @ 2013-03-07 20:05 UTC (permalink / raw)
  To: Andy Wingo; +Cc: 12892

() Andy Wingo <wingo@pobox.com>
() Thu, 07 Mar 2013 20:21:53 +0100

   [...] Dunno.

As an experiment, i've changed the cc to bug-guile in this response.
Maybe that will work.  Anyway, i'll followup w/ the debbugs folks.

-- 
Thien-Thi Nguyen
GPG key: 4C807502





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’
  2013-03-06 16:03         ` Andy Wingo
       [not found]           ` <87y5e0nxa0.fsf@zigzag.favinet>
@ 2013-03-13 11:09           ` Andy Wingo
  1 sibling, 0 replies; 8+ messages in thread
From: Andy Wingo @ 2013-03-13 11:09 UTC (permalink / raw)
  To: Thien-Thi Nguyen; +Cc: 12892-close

On Wed 06 Mar 2013 17:03, Andy Wingo <wingo@pobox.com> writes:

> Guile 2 does not track the number of bytes freed -- only the bytes
> that are mallocated.

For this reason I'll close this bug, as it doesn't seem possible to
provide a good estimate on the current amount of bytes that are live but
untracked by GC.

Andy
-- 
http://wingolog.org/





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-03-13 11:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-15  8:42 bug#12892: ‘gc-stats’ w/o ‘bytes-malloced’ Thien-Thi Nguyen
2013-03-05 17:52 ` Andy Wingo
     [not found]   ` <87fw09oz2w.fsf@zigzag.favinet>
2013-03-06  7:00     ` Andy Wingo
     [not found]       ` <87boaxotz6.fsf@zigzag.favinet>
2013-03-06 16:03         ` Andy Wingo
     [not found]           ` <87y5e0nxa0.fsf@zigzag.favinet>
2013-03-07  6:53             ` Andy Wingo
     [not found]               ` <87txono0k2.fsf@zigzag.favinet>
2013-03-07 19:21                 ` Andy Wingo
2013-03-07 20:05                   ` Thien-Thi Nguyen
2013-03-13 11:09           ` Andy Wingo

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).