Re: [report] memory leaks in COPY FROM on partitioned table

From: Kohei KaiGai <kaigai(at)heterodb(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Michael Paquier <michael(at)paquier(dot)xyz>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [report] memory leaks in COPY FROM on partitioned table
Date: 2018-08-04 13:29:28
Message-ID: CAOP8fzZNBn8ksjSe4qgtKd6+a7aCdXdZ6UTx=YPQi_VGnnkTJQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2018-08-03 12:38 GMT+09:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
> On 2018-Aug-03, Kohei KaiGai wrote:
>
>> 2018-08-02 5:38 GMT+09:00 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
>> > On 2018-Aug-01, Alvaro Herrera wrote:
>> >
>> >> Right, makes sense. Pushed that way.
>> >
>> > KaiGai, if you can please confirm that the pushed change fixes your test
>> > case, I'd appreciate it.
>>
>> Can you wait for a few days? I can drop the test dataset and reuse the storage
>> once benchmark test is over....
>
> Of course -- take your time.
>
I could load the same data (544GB csv, 789GB heap) using COPY FROM successfully.
When I reported the problem, rss usage of postgresql process increased
about 10MB/s ratio,
then OOM killer eliminated after a few hours.

Now, it consumed about 60MB rss at the beginning of COPY FROM, and it grows up
very slowly during the COPY FROM execution, then grew up to 250MB
before completion.
We may have another memory blocks which are not released during
execution, however,
I could not identify whether it is really memory leaking or not, and who's jobs.

It may be an idea to put a debug code that raises a notice when
MemoryContext allocates
more than the threshold.

Thanks,
--
HeteroDB, Inc / The PG-Strom Project
KaiGai Kohei <kaigai(at)heterodb(dot)com>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonathan S. Katz 2018-08-04 15:58:41 Re: Draft release notes are up
Previous Message Surafel Temesgen 2018-08-04 13:09:51 Conflict handling for COPY FROM