[mercury-users] garbage collection

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Oct 23 20:06:55 AEDT 2000

On 23-Oct-2000, Michael Day <mcda at students.cs.mu.oz.au> wrote:
> When does garbage collection occur, and is it configurable?

Garbage collection occurs whenever the garbage collector decides it is time ;-)
This is implementation-specific.  But for our current implementation,
yes, it is configurable, using the interface defined in "gc.h".
That file is in the boehm_gc directory in the source distribution,
and by default it gets installed into the
/usr/local/mercury-<VERSION>/lib/mercury/incs directory.

For details, see boehm_gc/gc.h and boehm_gc/README files in the source
distribution.  In particular, see the documentation in gc.h for
the following facilities:

	GC_free_space_divisor		tune the frequence of collection
	GC_dont_gc 			inhibit collection
	GC_gcollect() 			force a full collection
	GC_collect_a_little()		do a little bit of GC work;
					its handy to do this while waiting
					for I/O, for example
	GC_enable_incremental()		enable incremental collection
	GC_full_frequency		tune the frequence of full vs partial

As yet there is no Mercury interface to these C functions and variables;
you need to use Mercury's C interface to access them.  (Providing a
Mercury module with a Mercury interface to the all these facilities
would make a nice task for some enthusiastic volunteer ;-)

The Mercury standard library procedure io__report_stats will show
implementation-specific performance statistics; in our current
implementation, the output includes the number of full garbage
collections that have occurred.

Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list