I want to Know how can I make my python program run in such a say that it takes only specified amount of memory (say x bytes) to run, and in case of it requires more memory than x it should be terminated.
I want something like this:
if memory_required > x:
Terminate program
else:
Let the program run