On Mar 7, 2008, at 13.59h, Thomas Joad wrote: > fun one_attempt () = Search.searchAll (queens 11); > one_attempt(); (* I call this many times until my RAM is > exhausted *) > > 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
As Guido points out in his answer, the problem is that the Gecode binding can cause the C++ heap to grow much faster than the ML heap. The Alice runtime does not know about the size of the foreign heap, so ML-side GC (which would also release some of the C++ objects) is not triggered early enough. In fact, this is a general problem with FFIs, and I'm not aware of a good solution. Guido suggests Space.discard as a solution. What you can also try is triggering GC manually, by calling Store.collect occasionally, see: http://www.ps.uni-sb.de/alice/manual/library/store.html I would assume that this also eliminates the problem. It is a bit more convenient, but also more expensive than individual calls to Space.discard. - Andreas _______________________________________________ alice-users mailing list [email protected] http://www.ps.uni-sb.de/mailman/listinfo/alice-users
