views:

21

answers:

1

How to automatically close process that uses more that specified amount of memory on Windows? Is it possible to specify some amount of memory (for example 1MB) and to run some executable file with those parameters? If the process tries to allocate more than that amount of memory it should close and return some error value. Is there an easy way to do something like that on Windows? Excuse my English.

A: 

You can use this SO answer to get memory performance stats and TerminateProcess to kill it.

Jacob