@mark wrote: when I use EDB9.5,memory usage is high and OOM is occured.EDB process used over 90% memory. postgresql.conf is below: shared_buffers = 2048MB # min 128kB #work_mem = 4MB # min 64kB max_connections = 1000 when I used showall,work_mem is 56688kB . shared_buffers | 2GB work_mem | 56688kB max_connections | 1000 I want to know, OOM have relation with work_mem? need to set work_mem? How suitable is work_mem size? It could. Are you really establishing 1000 connections? The server will allocate at least 1x work_mem for each connection that is established (and maybe more depenending on whether the SQL you execute uses ORDER BY clauses, or causes merge/hash joins). How much memory is allocated for this server? The suitability of the current setting of work_mem depends a lot on how much memory is allocated to your system, and how many active connections you expects. If the value is too small, sorting operations will spill out to the disc, and your performance on those operations will be adversely affected. You can turn on loggin for temp file creation by setting log_temp_files (see https://www.postgresql.org/docs/9.5/static/runtime-config-logging.html for details).
... View more