Hello, Mr. Tack:
I want to thank you (and everyone on this list) for your quick reply to my
question. I wasn't sure how active the Alice project was, so I was delighted to
get responses from so many people. :-)
I tried your suggestion, but it doesn't seem to solve the problem completely. I
see, now, that GC happens every increment of 100MB or so. At that point, it
retreats, but soon memory usage climbs back up beyond its previous level,
retreating again, and climbing even higher.
My new version I'm using discards the spaces and explicitly calls the collector:
fun one_attempt () =
let val (a, b) = Search.searchAll (queens 11) in
List.map (fn space => Space.discard space) a;
Store.collect 50 end;
Are there any other options for keeping memory in check?
My goal is to use Alice in a production environment for my company, running as
a constraint-solving server behind a Web server. I fear that its memory
appetite will make the service unreliable.
Yours truly, Thomas
Guido Tack <[EMAIL PROTECTED]> wrote: 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
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search._______________________________________________
alice-users mailing list
[email protected]
http://www.ps.uni-sb.de/mailman/listinfo/alice-users