On Apr 8, 2010, at 11:25, Alessio Stalla wrote:
- the new behaviour should not be an ERROR but a WARNING, in my
opinion. You can react to it or ignore it. After all, low-memory is not the same as no-more-memory.
Actions to be taken in low memory can also be (might particularly be) unrelated to what's currently on the stack (dynamic scope), such as clearing caches. On the other hand, condition handlers are always dynamically scoped. It might be good to have a way to register global handlers for the low memory warning.
On the other hand, what thread is a global handler called in, when? For that matter, when might a condition be signaled -- what if it's the result of an allocation in the middle of a subsystem in an inconsistent state? OOM always has this problem, but in the low memory case it's more feasible to recover well (since you have some room to calculate your cleanup), so you need to think more about not accidentally breaking invariants.