chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] How to measure time spent in the garbage collector?


From: felix winkelmann
Subject: Re: [Chicken-users] How to measure time spent in the garbage collector?
Date: Sun, 21 Aug 2005 18:53:40 +0200

On 8/21/05, address@hidden
<address@hidden> wrote:

> Maybe this aspect of 'time' should be added to the manual :-)

       0 seconds elapsed
       0 seconds in (major) GC
      11 mutations
       0 minor GCs
       0 major GCs

I think line 2 speaks for itself... ;-)

> 
> I think that I have some large data structures (100-200 MB stored in files)
> that need no GC.
> They are deeply nested lists or vectors which the program 'read's once
> on startup (they are rarely modified).
> How can I tell 'read' (or a similar function) to put them on the heap?

You can use `object-evict' (lolevel unit), but modification is not
allowed (unless
you're modifying strings or byte-/number-vectors. Note that this eviction
process will copy symbols and so makes them not eq? to a non-evicted symbol
of the same name:

#;2> (use lolevel)
; loading library lolevel ...
#;4> (object-evict '(abc 1 2 (3)))
(abc 1 2 (3))
#;5> (define e #)
#;6> ,d e
statically allocated (80a2e20) list of length 4
 0: abc
 1: 1
 2: 2
 3: (3)
#;6> (eq? 'abc (car e))
#f
#;7> ,d 'abc
unbound symbol with name "abc"
#;7> ,d (car e)
statically allocated (80a2e30) symbol with name "abc"
#;8> (eq? 'abc (object-unevict (car e)))
#t


cheers,
felix




reply via email to

[Prev in Thread] Current Thread [Next in Thread]