Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sE7Ud-00HKlv-0i for pgsql-general@arkaria.postgresql.org; Mon, 03 Jun 2024 13:12:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sE7Uc-00AT5X-HW for pgsql-general@arkaria.postgresql.org; Mon, 03 Jun 2024 13:12:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sE7Uc-00AT5O-6M for pgsql-general@lists.postgresql.org; Mon, 03 Jun 2024 13:12:54 +0000 Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sE7UZ-0028I4-S0 for pgsql-general@postgresql.org; Mon, 03 Jun 2024 13:12:53 +0000 Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2eaac465915so11485361fa.1 for ; Mon, 03 Jun 2024 06:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717420371; x=1718025171; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=IO5GTi7Rpnsql/oPjxPCMGaJ0Lg1JJ51GlkuIQtWEhE=; b=edJXt3niI6Fty/DgO1/DL63Z1ctk7pqDIbqmSiXOLL3shcBkTVATHRiLEIdr0uLlpW 4Dq4bwfbGvd2XiYjtf6+rf/EaOlX6owO/vZXVDM4KtYdd4mmcH8bIndpiRC6BkHHVRLT A+sB8Ci/73+nBfebAs+BQ1gmnlm7yo7CK1Lq67Se0jQner1n6/5o9c1M2B7k9fbxn+EX c7O1OpQhgAZEV/Vlmkvw4ZdTlK5FTOnaefO3rHzb62LqFeKUMA37/wKuzIG4g7nCkQ55 Sxmy+RTmky020UVspSDJDdBkz9XHPb1ub1m97ektHkLieKjbSXwNoMwKPCtqqMFZORiX 3djg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717420371; x=1718025171; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IO5GTi7Rpnsql/oPjxPCMGaJ0Lg1JJ51GlkuIQtWEhE=; b=xPHUYipAhOZIUjR2b5EKtASWvTiX8ceNrjFdEhytwTo9/nX08od7jJQYB46k+r/CXx 0gVAIHTi8i/2qa9g7Z8UX1YiEBS0Fw9y55xMKHOJLqcEBAZU4XcurO1z+va79YaxOLUG RREh0xQiFVpciq+BkRbdFnNxbDK1oW4dKnZnf0LorkAc4Uctu2my8IRi5diBKXCa1AUQ Q8ieBTZi3Im9iqboKwQUpZJOnCYnQ35iRiHGQO13j264Jxla2Wf+SkxZf0S8L1S0o79Q ZuKTo+iySn6m8mwx2VAyqF5ZvcenXwcWk5G8z6E9xmS09jEA39RXFKBTt0NpzC5W4grD tqfA== X-Gm-Message-State: AOJu0YwNYEBQ6tCqtLi9vtmchBjW6ycByFXYrm6tYpZjRTFMimQZNrIB UrYleEk6FUI3kegN5OBuZ8/dxbb+QE3eotAJs6GguVg25w1VeASkMbTyPXmKPOwFVeEtp1z/aIk M/KbNFTYs/sXl9Q7RaEK6tHZfkjSAxAsh X-Google-Smtp-Source: AGHT+IEezMliDfapIj1awRAsNKatx6jsM3tNKedp0bwctw39dxq3/kcInokIQnAUABL2fLN7A/5qpgCO1/XXUzSXxaM= X-Received: by 2002:a05:651c:2117:b0:2e5:685a:cd24 with SMTP id 38308e7fff4ca-2ea950fd7demr65527331fa.6.1717420371114; Mon, 03 Jun 2024 06:12:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Greg Sabino Mullane Date: Mon, 3 Jun 2024 09:12:13 -0400 Message-ID: Subject: Re: Postgresql 16.3 Out Of Memory To: Radu Radutiu Cc: pgsql-general Content-Type: multipart/alternative; boundary="0000000000002686290619fc17c1" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000002686290619fc17c1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Jun 3, 2024 at 6:19=E2=80=AFAM Radu Radutiu wr= ote: > Do you have any idea how to further debug the problem? > Putting aside the issue of non-reclaimed memory for now, can you show us the actual query? The explain analyze you provided shows it doing an awful lot of joins and then returning 14+ million rows to the client. Surely the client does not need that many rows? You can probably also prevent OOM by lowering your work_mem and/or your max_parallel_workers_per_gather. Cheers, Greg --0000000000002686290619fc17c1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Jun 3, 2024 at 6:19=E2=80=AFAM Ra= du Radutiu <rradutiu@gmail.com= > wrote:=C2=A0
Do you have any idea how= to further debug the problem?=C2=A0

Putting aside the issue of non-reclaimed memory for now, can you show= us the actual query? The explain analyze you provided shows it doing an aw= ful lot of joins and then returning 14+ million rows to the client. Surely = the client does not need that many rows?

You can p= robably also prevent OOM by lowering your work_mem and/or your max_parallel= _workers_per_gather.

Cheers,
Greg
<= div>
--0000000000002686290619fc17c1--