Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3tse-0002TW-Oh for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 03:49:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3tsd-00060H-CI for pgsql-bugs@arkaria.postgresql.org; Tue, 18 Feb 2020 03:49:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j3tsc-000603-Me for pgsql-bugs@lists.postgresql.org; Tue, 18 Feb 2020 03:49:03 +0000 Received: from sonic304-19.consmr.mail.sg3.yahoo.com ([106.10.242.209]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j3tsY-0004ME-Cq for pgsql-bugs@lists.postgresql.org; Tue, 18 Feb 2020 03:49:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.hk; s=s2048; t=1581997734; bh=6FRB7HlAQh4jquXV5ACJu+PbcCUdAoNFIICcGB239c4=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From:Subject; b=sTzMT1CHzfRIKo93wLMrnXvFdvYHJvthf1Ysuv5FQr1Xi4tpBmnyGb86BxeVdqpXPaTSwqgoxDQuBEvHXrATCMh522yCSB9k7J738vDhwgrfgcUaZ486GB4mX5WhQDLvagzm1E6XjUwQgYer/48su6vl/Ze0kN4tivx8tXfaXFwpj0m1QTGTPEJodJ3OX33LWuBTjcQRBtGayngy64NVgagQUzCJc85F19o0XV2HmTjq5V3YVbh6ZHbKcMM6v83m/0N0UNo7p598aURipz9q4auEBbewQBLyulggsyoY9BQUhUEx4kNR2tRx2b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I3kFB9I13KglAs 958TvkC04dU1v0lidS5kvmsTnEVVyDxV8ANJyjNVyb8I1VGbi10LWSGNOI2C.k_vTny8dCZrfD2m 1Ix9D6K79evs.EBx0arV.2IggOQYR_2ipheAAiuwCoxmMcGXIawJvSVgXcxX3RDcNy0dtOD9M0XV 5yoE3pGjCRca.jNW63pdV0wumwBPooz_O.JPJ.Ube_4sZ1nlxR8FZmIDBzgFeyHyWxJKXtI7Pr2C ZnYhRr7RAB__og3LRqpvc2tKixlm34P.s76uEVz.FlQ5oZpFaMn3y_pRLAXFkWGfSDBkuFVE9cgC vxq4lJvExaBDSOg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.sg3.yahoo.com with HTTP; Tue, 18 Feb 2020 03:48:54 +0000 Date: Tue, 18 Feb 2020 03:48:49 +0000 (UTC) From: Hazuki Amamiya To: Tom Lane Cc: "pgsql-bugs@lists.postgresql.org" Message-ID: <101845571.3678442.1581997729928@mail.yahoo.com> In-Reply-To: <24064.1581978144@sss.pgh.pa.us> References: <26594723.3545403.1581955480512.ref@mail.yahoo.com> <26594723.3545403.1581955480512@mail.yahoo.com> <24064.1581978144@sss.pgh.pa.us> Subject: Re: Possible memory leak in PostgreSQL 12.2 on truncate, insert or delete when type interval is involved MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3678441_489132504.1581997729926" X-Mailer: WebService/1.1.15199 YMailNorrin Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0 Content-Length: 5180 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk ------=_Part_3678441_489132504.1581997729926 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Tom, Indeed my scripts seems not able to replicate what happened in my productio= n server. With my production script in my production server, both RES and V= IRT do increase. Just I am unable to replicate it with a simple script and = simple database schema. Since the workaround is rather easy by establishing a new connection sessio= n every certain time, I would like to close this bug report. Thanks for your help. hazuki On Tuesday, 18 February 2020, 06:22:41 GMT+8, Tom Lane wrote: =20 =20 Hazuki Amamiya writes: > Recently, there is a memory leak in the game server I hosted. After check= ing the log, the leak seems appeared after I upgrade PostgreSQL from 11 to = 12.1, and I have no luck even I upgraded the PostgreSQL to 12.2 [PostgreSQL= 12.2 (Debian 12.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (De= bian 8.3.0-6) 8.3.0, 64-bit] in Debian 10. FWIW, I see no sign of a memory leak with this example. > While the script continuing to run, the RES (shown in command =E2=80=9Cto= p=E2=80=9D) will keep increasing forever. Does it really increase "forever"?=C2=A0 A fairly common cause of confusion is that top will report the process' space consumption as gradually increasing until all of Postgres' shared buffers have been touched (after which the number stops growing).=C2=A0 That's not a leak, it's just an artifact of how top chooses to count usage of shared memory. Usually, if you don't see the total "VIRT" column increasing, there's no real leak happening. =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 regards, tom lane =20 ------=_Part_3678441_489132504.1581997729926 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Tom,

In= deed my scripts seems not able to replicate what happened in my production = server. With my production script in my production server, both RES a= nd VIRT do increase. Just I am unable to replicate it with a simple = script and simple database schema.

Since the workaround is rather easy by establishing = a new connection session every certain time, I would like to close this bug= report.

Thanks for your help.

hazuki
=20
=20
On Tuesday, 18 February 2020, 06:22:41 GMT+8, Tom Lane = <tgl@sss.pgh.pa.us> wrote:


Hazuki Amamiya <hatsuki_a-ie@yahoo.com.hk> writes:
>= ; Recently, there is a memory leak in the game server I hosted. After check= ing the log, the leak seems appeared after I upgrade PostgreSQL from 11 to = 12.1, and I have no luck even I upgraded the PostgreSQL to 12.2 [PostgreSQL= 12.2 (Debian 12.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (De= bian 8.3.0-6) 8.3.0, 64-bit] in Debian 10.

FWIW, I see no sign of a memory leak with this example.


> = While the script continuing to run, the RES (shown in command =E2=80=9Ctop= =E2=80=9D) will keep increasing forever.


Does it really increase "forever"?  A fairly common cause of= confusion
is that top will report the process' space con= sumption as gradually
increasing until all of Postgres' s= hared buffers have been touched
(after which the number s= tops growing).  That's not a leak, it's just
an arti= fact of how top chooses to count usage of shared memory.
= Usually, if you don't see the total "VIRT" column increasing, there's
no real leak happening.

&= nbsp;           regards, tom lane

------=_Part_3678441_489132504.1581997729926--