Is there a way to control memory consumption in .NET globally?
I am aware of MemoryFailPoint but I need to restrict it globally in my whole app. MemoryFailPoint
needs to be created for each next operation - and get disposed.
And since I am doing something heavily palatalized, I am not sure if MemoryFailPoint
would not meddle with TPL.
Just for fun instantiate an instance of this class:
class Bomb
{
public Bomb()
{
var t = new Task<Bomb>(() => new Bomb());
t.Start();
t.Wait();
Next = t.Result;
}
string TNT = new string('*', 1024 * 640);
public Bomb Next;
}