Is there a way to set a maximum memory usage for a 64 bit application?
Reason: when a 64 bit .net algorithm/application running on my laptop exceeds memory requirements of 3 GB, my computer gets really slow. (Stays slow after I manually terminate the program.) I would rather have the algorithm terminate when it is exceeding 3GB.
You could check the Process.WorkingSet64 Property.
If you want to limit the memory without checking it, because you’re calling external API’s, you could use
JobObjectWrapper. It allows you to create a process and limit the amount of memory this process can use.Edit: from the sample project: