Re: Possible memory leak in PostgreSQL 12.2 on truncate, insert or delete when type interval is involved

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hazuki Amamiya <hatsuki_a-ie(at)yahoo(dot)com(dot)hk>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: Possible memory leak in PostgreSQL 12.2 on truncate, insert or delete when type interval is involved
Date: 2020-02-17 22:22:24
Message-ID: 24064.1581978144@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hazuki Amamiya <hatsuki_a-ie(at)yahoo(dot)com(dot)hk> writes:
> Recently, there is a memory leak in the game server I hosted. After checking 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 (Debian 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 “top”) will keep increasing forever.

Does it really increase "forever"? 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). 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.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message RekGRpth 2020-02-18 02:48:06 Re: BUG #16258: exec_simple_query does not call ProcessCompletedNotifies after CommitTransactionCommand
Previous Message Andre Lucas 2020-02-17 20:38:34 PSQL Help