From paul@inet.co.za  Fri Jun  9 10:48:42 2000
Received: from exchange_rbk02.inet.co.za (exchange-rbk02.inet.co.za [196.38.91.22])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id KAA20043
	for <prolog@swi.psy.uva.nl>; Fri, 9 Jun 2000 10:48:39 +0200 (MET DST)
Received: from pdev.inet.co.za ([196.14.60.35]) by exchange_rbk02.inet.co.za with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21)
	id MMHDXBXH; Fri, 9 Jun 2000 10:50:44 +0200
Date: Fri, 9 Jun 2000 12:37:48 +0200 (GMT+0200)
From: Paul Sephton <paul@inet.co.za>
To: prolog@swi.psy.uva.nl
Subject: Heap heaping up?
Message-ID: <Pine.LNX.3.91.1000609123534.11510A-100000@pdev.inet.co.za>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hi, all.

When I run the following program, the heap just keeps getting bigger.  
Does the garbage collector have a memory leak?

:- dynamic
  myfact/2.

factfile('myfacts.pl').

change(_, _) :-
  factfile(FName), not(exists_file(FName)),
  tell(FName), nl, told, fail.
change(_, _) :-
  factfile(FName), consult(FName), fail.
change(X, Y) :-
  factfile(FName), retractall(myfact(X, _)), assert(myfact(X, Y)),
  tell(FName), listing(myfact), told.

go :-
  between(1,300,X), between(1,300,Y),
  change(Y, X),
  garbage_collect,
  statistics(heapused, HU),
  writef("Heap Used: %w(%w)\n", [HU]), fail.
go.
_____________________________________________________________________________
Paul Sephton (paul@inet.co.za)       Chief Systems Architect     I-Net Bridge 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ever wondered if jumping out of the frying pan might actually be refreshing?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

