Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIrlx-0008OE-Le for pgsql-general@arkaria.postgresql.org; Thu, 17 Sep 2020 11:08:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kIrlw-0008Ey-Lq for pgsql-general@arkaria.postgresql.org; Thu, 17 Sep 2020 11:08:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIrlw-0008Er-C7 for pgsql-general@lists.postgresql.org; Thu, 17 Sep 2020 11:08:16 +0000 Received: from mout.gmx.net ([212.227.17.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kIrlq-0001tu-6E for pgsql-general@lists.postgresql.org; Thu, 17 Sep 2020 11:08:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1600340888; bh=CgEqNiGl0Wq94F/xn185ehTXBCVqeo7VdiIG3aePs44=; h=X-UI-Sender-Class:Subject:To:References:From:Date:In-Reply-To; b=kvBii1B4qGW4CXUreZEWXT590sT9f4aSzv6M554XRxC0dNvIKIm3hDBbuq9ReTyLh QL7R8XDybBdY7lgViZZMc1z97+Z2mEaTPvx1fDr3a7N9ZH7zasiAliPHUkYK/5E7ms bUtEg3KTFXJubtyirMRXcbBS6DYJviG4/jmKLkx0= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.20] ([83.171.160.125]) by mail.gmx.com (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mirng-1kxipQ0d40-00eqs0 for ; Thu, 17 Sep 2020 13:08:08 +0200 Subject: Re: PostgreSQL processes use large amount of private memory on Windows To: pgsql-general@lists.postgresql.org References: From: Thomas Kellerer Message-ID: <7cbb6ebd-cb66-1e27-60fb-bccbf655d522@gmx.net> Date: Thu, 17 Sep 2020 13:08:06 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:1XcGvfmMlEiWusVPhwsStNs1TkjGMI+uaUf9RJRwqejmMiXXA1E c/ONuIrH4bkKF7UpiGw3KZ7yqIYzyC2YApm6eT1AoVhfpv6cjB2L5DmokSX9IJbaz8NdX4O DpDJv1hOK7YyejRr12baFdfy7Vv9kpIpaSb1SrdA9xrpVLIt65wND2SUZHxfSYyw3E+8nun qjrA8iPBvY6yJl7QPl8Dg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:FUL7j/XxhZ8=:YURxCAuF+9FOnJ08o3Gj3s zSKMi4ZyyT76P+dO8WfbS+uAgEaybHbe32KPV6rHe7/65SPvu0U7X3io3zbNnSbgb3pjVNjKr K0BSZtYO5K+wdvv+KbHbByX7Kx+RBiXxy5b8Yt/+JTmss1YyueQIRY5B0/YqWF9yeL0smkA3R LCEg3kBa7v4ADr7XmrOOh+MZA01+9+U+gdq3T0upbM09ndcJ9oMG4fiHoKTN+QQdcLwdZPNJT H90JztjC86G4RuOHyeVJcEpT8vBdKEhxQO6eVmNuLbEHvGYSup/dKr5G+Pq6IYH9TdztoLxJ6 AgLhBzgZb5CIgt5x+ruuAp8tfdCV6tjov1uxsBbiNlJYQ7eIeYYyaNNMmA/hB4ooitKPKoEJs TWk3x6j8ZQxTSF6Lg8aZ8K2eAZ60JV2y3opxu0N+/SY9SHbq8vtl+04a2lY3RL6pToeQ+9O0v Fa+78Ag0N5MoRBfnJiGQ4Ind31kDB/OHSn6vvNPg8Zd/kr7ljXhP2Zpz8YHdvgelF4wU6f1gY dNOEGxw7mzLUaktFKB97OcPPloSO4xsYqzwdQ0/5j1Tx6m3A5QuyXN1q2XDEo2JvmoR6hXmOq GK1y5f5Hgi/Z8Mlln/sDApIrFoGVij116nso4ICTI0yN7h7nACNLiffIdLBymHFMhpNsSltcy F+nSkRJYjjl5EVAsiBoWVGayHt6aRgfSm11sSmybWm4B63cVpwf4DxNdvmrjwpiRkILMwbm3l Ujy4I2DE2EKgFJaUrWPjBgke6tNfQuS6tbVxPa5RkLnOfdNYWPgZ1C/ecQL8l+8vs1GUh2NwM 8KkUJW+Nox8EKWpR3Dt4KMOlM7TEebM0sKSFse1AbN07d0ci5TfR75yU7CzOU7WQ3/H54T/Rl Jy86Dwai5LZw4F5JQ+7/JIPUUAgVM1fG9QP5JjyuTpkyj55JvrELcWgh/YZdCXQxBTgV24GDq hFADledXVqhqUBTrCUrgBVARf9hdwx3a0HkmSjUbH3uX5aQygow7456oOewWWTiwLZzFVFVnz zrOghcPIU6aHGMfcvt0aV2v8nv39qHjJh3J1DogKAAsIUwUEYqomNhclamXnB/rAeVtzAuEOW lkCnbIMuY2ks1iXAIwhw5l9A8Tt8DK0jnLhFWXLujCskADZQyUtGo0TjHgXlynfmrr9xswStW vTx8whw6D1floJTzaoOLi2Hnb3uPvH0Yjx/6o82BeYyRA4CYAijo0spoZVM6tCp0q8bV6lEav W3f3Rm51E20Rskd6t List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =C3=98ystein 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 (=3Dconnection) 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.