I was running an R program written by a third-party and for one specific dataset the process was getting killed. My machine had plenty of RAM available and the process was repeatedly getting killed by the OOM killer.
I read a little about the subject and I learned that I can tune the OOM killer by allowing my system to overcommit memory:
echo 1 > /proc/sys/vm/overcommit_memory
To permanently change this setting from 0 to 1, add this line to /etc/sysctl.conf:
After doing this, the R process is no longer getting killed.