Thomas,

your problem is indeed related to the one you cite.

Thomas Joad wrote:
> Each time I call one_attempt() (see below), memory usage goes up.  
> The GC only kicks in at two levels, 200 MB and 600 MB. But after  
> both times, memory creeps up beyond that level until my computer  
> starts thrashing (I have 2GB of RAM).
>
> The constraint problem I'm trying to run is the Queens problem from  
> the tutorial: http://www.ps.uni-sb.de/alice/manual/cptutorial/node32.html
>
> Here's my code:
> fun one_attempt () = Search.searchAll (queens 11);
> one_attempt();   (* I call this many times until my RAM is exhausted  
> *)

searchAll returns a list of spaces.  The Alice GC just sees this as a  
list of pointers, it doesn't know that there's a heavy object attached  
to each pointer.  The result is that the GC kicks in too late.

> This may be related to an earlier user problem, but unlike him, I'm  
> not doing anything special: 
> http://www.ps.uni-sb.de/pipermail/alice-users/2006/000706.html

The solution is to explicitly discard the returned solutions as soon  
as you don't need them any more (using Space.discard).  For the little  
example, something like

app (fn s => Space.discard s) (one_attempt())

should do the trick (although that way the example becomes even less  
useful ;-) ).

Cheers,
        Guido


_______________________________________________
alice-users mailing list
[email protected]
http://www.ps.uni-sb.de/mailman/listinfo/alice-users

Reply via email to