You can ask the kernel to panic on oom:
sysctl vm.panic_on_oom=1
or for future reboots
echo "vm.panic_on_oom=1" >> /etc/sysctl.conf
You can adjust a process's likeliness to be killed, but presumably you have already removed most processes, so this may not be of use. See `man 5 proc` for `/proc/[pid]/oom_score_adj`.
Of course, you can test the exit code of your program. If it is 137 it was killed by SIGKILL, which an oom would do.
If using `rsyslogd` you can match for the oom message (I don't know what shape that has) in the data stream and run a program:
:msg, contains, "oom killer..." ^/bin/myprogram