Hello bearophile,

Walter Bright:

You can design a system that has "free these blobs of memory I'm
keeping in reserve if I run out and hopefully that will be enough",
but that strategy needs to be part of the gc itself, not user
recovery code.

Do you mean that the D2 GC API needs to grow something to tell that a
less important memory block (object, array) can be deallocated by the
GC in low memory conditions? How can this work in the user code?


I'd add some way to registere GC panic delegates that get called until enough memory is available, maybe from some sort of priority queue.


(And it can be positive to define a standard way the D GC talks with
the virtual memory subsystem of the operationg system, to avoid
useless swaps from and to disk).

IIRC virtual memeory and swapping has little or nothing to do with OOM errors.


Bye,
bearophile


Reply via email to