pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Thomas Kellerer <shammat@gmx.net>
To: pgsql-general@lists.postgresql.org
Subject: Re: PostgreSQL processes use large amount of private memory on Windows
Date: Thu, 17 Sep 2020 13:08:06 +0200
Message-ID: <7cbb6ebd-cb66-1e27-60fb-bccbf655d522@gmx.net> (raw)
In-Reply-To: <CAH_oh=wk5i36whfUKhPvnTfR6KsU_CzRTXecNaAtY86HWb57YQ@mail.gmail.com>
References: <CAH_oh=wk5i36whfUKhPvnTfR6KsU_CzRTXecNaAtY86HWb57YQ@mail.gmail.com>

Øystein Kolsrud schrieb am 17.09.2020 um 11:19:
> All settings typically referred to (like "work_mem" and
> "temp_buffers") are at default settings, and I have a very hard time
> seeing how those settings could add up to memory in the magnitude of
> 200MB. The "max_connections" settings is quite high (>1000), but
> there are nowhere near that many connections active in the system.
> The only way I have been able to trigger growth of processes in my
> tests is to extract large amounts of data, but when I do that, it is
> always the "shared working set" that grows. "private working set"
> remains stable at around 5 MB.


It's not clear to me how many open (vs. "active") connections you have.
An "active" connection is one that is currently _running_ a statement,
an "open" is one that is "idle", i.e. not doing anything.

To my knowledge, a single backend process (=connection) will not release
the memory it once allocated. The only way to free that memory is to
physically close the connection.

So if all your > 1000 connections are currently idle/open (but not "active"),
they will still consume the memory they have allocated _when_ they where
active.

With that high number of connections it isn't really surprising that
you run out of memory at one point or another then.






view thread (7+ messages)  latest in thread

Message-ID: <7cbb6ebd-cb66-1e27-60fb-bccbf655d522@gmx.net>
Permalink:  ../7cbb6ebd-cb66-1e27-60fb-bccbf655d522@gmx.net/
Also on:    postgresql.org/message-id/7cbb6ebd-cb66-1e27-60fb-bccbf655d522@gmx.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: shammat@gmx.net
  Subject: Re: PostgreSQL processes use large amount of private memory on Windows
  In-Reply-To: <7cbb6ebd-cb66-1e27-60fb-bccbf655d522@gmx.net>
  References: <CAH_oh=wk5i36whfUKhPvnTfR6KsU_CzRTXecNaAtY86HWb57YQ@mail.gmail.com> <7cbb6ebd-cb66-1e27-60fb-bccbf655d522@gmx.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox