Stephan Knauss <pgsql@xxxxxxxxxxxxxxxxxx> writes: > The wiki suggested to dump MemoryContext states for more details, but > something strange happens when attaching gdb. It seems that the process > is immediately killed and I can no longer dump such details. You might try running the postmaster under a restrictive ulimit (I think the -v option is the one that matters on Linux, not -d as you might guess). The idea here is that the backends would get an actual ENOMEM failure from malloc() before reaching the point where the kernel's OOM-kill behavior takes over. Given that, they'd dump memory maps to stderr of their own accord, and you could maybe get some insight as to what's leaking. This'd also reduce the severity of the problem when it does happen. regards, tom lane