On Wed, 2007-08-29 at 12:05 -0400, Sandro Magi wrote: > Why does the memory use blow up like that?
Not sure. I wouldn't have expected so many temporaries to be created.. but there are no closures involved, so it has to be all temporary lists. > Isn't memory allocation a > service call? No, it's an ordinary function call. Service calls are yields, which are only possible in the absence of machine stack. In Felix functional code uses the machine stack for C/C++ function call compatibility. > If it were, then it seems like GC could run every X > allocations. > > Also, perhaps region-based memory management would be appropriate in > some cases. The inner map in your example could run in a single region > that's collected on function exit. > > Boehm-GC is world-stop, but it has an incremental mode as well. Yes but that wasn't what I meant. Incremental is still world stop -- just more shorter stops dividing the work up. So for multiple threads .. it still has to stop all the threads. So on a 64 CPU machine .. all 64 CPU's idle during GC, plus there is a latency waiting to stop them .. incremental mode is actually very bad. However, Boehm suspends the threads itself, transparently. Felix does this by blocking the threads on their next service call. As above .. there are no service calls in functional code. Unless you cheat, or the optimiser makes guarantees to eliminate certain things. The gc test code I'm using is now fully flattened procedural code. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language