On Tue, Dec 11, 2012 at 10:26 AM, Igor Stasenko <siguctua@gmail.com> wrote:
hehe..
it looks like we can do it:

�- when memory hits the waterline mark, VM should do the following:
� �- for every currently scheduled process , push an artificial stack
frame on top , which is
StackOverflow signal.

If the VM supports the LowSpaceSignal mechanism as it used to be then this can be done in the image with a high-priority process. �And tehrefore it can e.g. be avoided for processes such as the Delay process, where IMO it is inappropriate.

Then the first thing what this guy should do, when he will get
control, is to analyze
how deep is the stack of given process and if it surpassed the allowed
threshold,
and if there's no handler, then decide whether to kill the process or not.

Also, since it is exception, a user code can intercept this exception and
either ignore it (effectively forcing system to keep running), or otherwise
terminate process, but in an educated manner, since he might have a
better knowledge,
what can eat so much resources in his code.. as well, as do a gracious failure
handling, e.g., correctly clean associated system resources etc.


--
Best regards,
Igor Stasenko.




--
best,
Eliot