Re: Memory growth observed with C++ application consuming libpq.dll on Windows

From: Rajesh Kokkonda <rajeshk(dot)kokkonda(at)gmail(dot)com>
To: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Cc: Yasir <yasir(dot)hussain(dot)shah(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Memory growth observed with C++ application consuming libpq.dll on Windows
Date: 2024-08-06 08:33:32
Message-ID: CAM4OfG35ys6CCG8i2Q24HegVfcbmzE55gptN9-7T2TibcxW9jw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I ran a trial version of a memory leak detector called Deleaker on windows
and found some modules that are listed as having leaks. I ran the program
on Linux under valgrind and I do not see any leaks reported there. I have
attached the reported leaks on windows as windows_leaks.txt and valgrind
summary report as valgrind.txt.

I am working on generating a trimmed down version of the sample program to
share with you. Let me know if you have any questions.

Thanks,
Rajesh

On Fri, Aug 2, 2024 at 10:19 PM Rajesh Kokkonda <rajeshk(dot)kokkonda(at)gmail(dot)com>
wrote:

> We did run our application under valgrind on Linux. We did not see any
> leaks. There is no platform dependent code in our application. We are
> seeing gradual memory growth only on windows.
>
> That is what lead me to believe the leak may be present in postgresql. I
> will run under available memory tools on windows and get back to you.
>
> I will also try to create a sample and see if I can reproduce the problem.
>
> Thanks,
> Rajesh
>
> On Fri, 2 Aug 2024, 21:45 Ranier Vilela, <ranier(dot)vf(at)gmail(dot)com> wrote:
>
>> Em sex., 2 de ago. de 2024 às 11:54, Rajesh Kokkonda <
>> rajeshk(dot)kokkonda(at)gmail(dot)com> escreveu:
>>
>>> Okay. I will try to create one sample program and send it to you
>>> sometime next week. In the meantime, I am listing down all the methods we
>>> are consuming from libpq.
>>>
>>> PQconnectdbParams
>>> PQstatus
>>> PQerrorMessage
>>> PQpingParams
>>> PQfinish
>>> PQresultStatus
>>> PQclear
>>> PQsetSingleRowMode
>>> PQntuples
>>> PQnfields
>>> PQftype
>>> PQgetvalue
>>> PQgetlength
>>> PQgetisnull
>>> PQgetCancel
>>> PQfreeCancel
>>> PQcancel
>>> PQsetErrorVerbosity
>>> PQsendPrepare
>>> PQsendQueryPrepared
>>> PQgetResult
>>> PQconsumeInput
>>> PQisBusy
>>> PQsetnonblocking
>>> PQflush
>>> PQsocket
>>> PQtransactionStatus
>>> PQresultErrorField
>>>
>>> It is highly likely that the memory consumption is caused by your
>> application.
>> Perhaps due to the lack of freeing up the resources used by the library.
>> You can try using this tool, to find out the root cause.
>>
>> https://drmemory.org/
>>
>> best regards,
>> Ranier Vilela
>>
>

Attachment Content-Type Size
valgrind.txt text/plain 537 bytes
windows_leaks.txt text/plain 3.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rajesh Kokkonda 2024-08-06 08:36:18 Re: Memory growth observed with C++ application consuming libpq.dll on Windows
Previous Message Alexander Korotkov 2024-08-06 08:18:05 Re: [HACKERS] make async slave to wait for lsn to be replayed