Try a userspace oom.
EarlyOOM has been a life saver for me, but there is a few others.
AFAIK Fedora and Clear linux have begun shipping EarlyOOM by default.
nohang's README have a gist about other projects.
nohang's README have a gist about other projects.