Re: valgrind on initdb - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: valgrind on initdb
Date
Msg-id ee277558-d735-07bb-925c-944b97a1cb67@2ndQuadrant.com
Whole thread Raw
In response to Re: valgrind on initdb  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: valgrind on initdb  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 11/7/18 9:11 AM, Tomas Vondra wrote:
>
> On 11/7/18 2:47 PM, John Naylor wrote:
>> On 11/7/18, Jesper Pedersen <jesper.pedersen@redhat.com> wrote:
>>> Hi,
>>>
>>> While looking at [1] (included in 23315.log) there are other warnings as
>>> well.
>> Perhaps it's worth revisiting to make debugging easier, but right now
>> initdb.c has this comment:
>>
>>   * Note:
>>   *     The program has some memory leakage - it isn't worth cleaning it up.
>>
> Maybe. I certainly don't think it's not worth the time merely for the
> sake of fixing the memory leaks. The reasoning here is that initdb runs
> for a short period of time (a couple of seconds, really), and the memory
> gets released when the process exits. And the leaks are tiny in general
> - a couple of bytes here and there. Had there been a massive memory leak
> that would change the equation of course.
>

Yeah, I'm pretty sure I wrote that comment 15 or so years ago in the 
first C implementation of initdb. I don't think my opinion has changed 
much. We're talking about kilobytes, here, nothing massive.


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pread() and pwrite()
Next
From: Tom Lane
Date:
Subject: Re: Connection limit doesn't work for superuser