Tweaking swap settings and some other things might help. So could early-oom for a rather automated killer…
early-oom