On Wed, Dec 20, 2017 at 9:25 AM, Andreas Kretschmer <andreas@xxxxxxxxxxxxxxx> wrote: > > > Am 20.12.2017 um 16:08 schrieb mark: >> >> postgresql process used over 70% of memory and occuered OOM. >> what should I do to deal with this problem? > > > https://www.postgresql.org/docs/current/static/kernel-resources.html > 18.4.4. Linux Memory Overcommit More specifically: https://www.postgresql.org/docs/current/static/kernel-resources.html#LINUX-MEMORY-OVERCOMMIT To reiterate the basic message there, at no time should the OS think that killing big processes is OK. It is NOT. At no time should your OS be terminating big processes all on its own. Also it's far better to starve your work_mem and keep all the processes running than to ever run any out of memory. But if one does run out of memory it should only cause a problem for that one process, not the backend writer etc.