# Tell Linux not to overcommit memory.
# PostgreSQL does not like to crash in unexpected places, which happens
# when Linux overcommits memory and the OOM killer kills postgres.
#
# After changing run:
#   systemctl restart systemd-sysctl
#
# See:
# https://docs.kernel.org/admin-guide/sysctl/vm.html
# https://knowledge.enterprisedb.com/hc/en-us/articles/14794279253148-Postgres-memory-recommendations-Linux-overcommit-and-OOMs
vm.overcommit_memory = 2
vm.overcommit_ratio = 80
