On 16/09/2010 12:52, Tjark Weber wrote:

I'll be happy to test a fix/the next release on my machine when you have
one.

I've now had a chance to look at this and I've installed some experimental changes to SVN.

I've added some handlers to the C++ "new" allocator so that it shouldn't crash if the allocation fails. Instead there should be an ML exception if there is insufficient memory.

I've added a command-line option (--stackSpace=n) to reserve some memory for thread stacks and the C++ heap. Whenever Poly/ML wants to extend the heap it tries to keep "n" megabytes of memory in reserve. In Linux the default stack size seems to be 8Mbytes but the actual value is set by
ulimit -s
It seems it also needs 1-2 Mbytes in addition, probably for the C++ heap. The default for the option is currently zero so I'd like some feedback on how it works.

For testing I've also added a --heapmax option. This simulates the effect of Poly/ML growing the heap as far as it will go by allocating as much space for the heap as possible when poly starts up. I'll remove this when the testing is complete.

Could you test this by seeing whether you now get an ML exception instead of the crash and also see whether specifying
--stackspace=50 (say) avoids the problem?

Regards,
David
_______________________________________________
polyml mailing list
polyml@inf.ed.ac.uk
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml

Reply via email to