Thanks for the extra detail. Note that
A 137 code is issued when a process is terminated externally because of its memory consumption
So there is a problem with the amount of virtual memory. It’s not strictly about RAM, but you either need more RAM or more swap. Or, possibly, you need to change the kernel policy.
In my case I see
# cat /proc/sys/vm/overcommit_memory
1
and also
# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
Both of which are recommended settings. What do you have?