Are you sure it was OOM? Just in case, run memtest.
Also make sure to setup enough swap. Swap is literally almost free RAM. Sure it won't replace it, but on 8gb shitbox, having 32GB on swap really helps. Especially if swapping starts at 70% of ram usage.
And zswap to make less writes to nvme and make it last longer.