Cool, could you maybe do a proof of concept someday ;-) On 11 Dec 2012, at 19:26, 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.
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.