Inflate a memory balloon process with a high OOM score and a watchdog process that triggers a warning when the balloon pops.
$ gcc balloon.c -o balloon$ python watchdog.py 300The number 300 indicates the size of the balloon in mebibytes.
Add an executable file alarm (script or otherwise) or configure a custom response in watchdog.py.