HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

How to debug when OS kills postgres for high memory usage

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
howpostgreskillsdebughighusageformemorywhen

Problem

I am running Postgres 9.4 server in a VPS running Ubuntu. It gets killed often (multiple times in a day).

This is the message from dmesg

Out of memory: Kill process 1020 (postgres) score 64 or sacrifice child

Killed process 1020 (postgres) total-vm:445764kB, anon-rss:140640kB, file-rss:136092kB

How to debug what is causing this crash? Is it long running queries or some misconfiguration of the server or lots of idle connections open?

Solution

It's the OOM killer in the Linux kernel. Disable VM overcommit, per the advice in the PostgreSQL manual.

Context

StackExchange Database Administrators Q#131349, answer score: 5

Revisions (0)

No revisions yet.