Subject: Heap heaping up?

From: Paul Sephton <[email-masked]>
Date: Fri, 9 Jun 2000 12:37:48 +0200 (GMT+0200)

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 ([email-masked])       Chief Systems Architect     I-Net Bridge 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ever wondered if jumping out of the frying pan might actually be refreshing?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~