当操作系统因高内存使用而杀死 postgres 时如何进行调试

Len*_*ran 5 postgresql performance postgresql-9.4 postgresql-performance

我在运行 Ubuntu 的 VPS 中运行 Postgres 9.4 服务器。它经常被杀死(一天多次)。

这是来自 dmesg

内存不足:杀死进程 1020 (postgres) 得分 64 或牺牲子进程

杀死进程 1020 (postgres) total-vm:445764kB, anon-rss:140640kB, file-rss:136092kB

如何调试导致此崩溃的原因?是长时间运行的查询或服务器的某些错误配置还是打开了大量空闲连接?