Postgres instance restarted multiple times with out of memory errors. I could not understand what process would have consumed all memory.
2020-09-03 04:54:14 PDT LOG: could not fork new process for connection: Cannot allocate memory TopMemoryContext: 799496 total in 13 blocks; 63080 free (17 chunks); 736416 used TopTransactionContext: 8192 total in 1 blocks; 7960 free (0 chunks); 232 used
Here are the current settings. Postgres version is 10.5.12
effective_cache_size | 16GB
maintenance_work_mem | 1GB
max_wal_size | 4GB
max_worker_processes | 8
temp_buffers | 8GB
work_mem | 256MB
shared_buffers | 32GB
max_connections | 3000
vm.overcommit_memory = 2
vm.overcommit_ratio = 80
-sh-4.2$ free -g
total used free shared buff/cache available
Mem: 62 9 0 36 52 16
Swap: 0 0 0
Can you please suggest if any configuration changes required.