From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andres Freund <andres@anarazel.de>
Cc: Tomas Vondra <tv@fuzzy.cz>
Cc: pgsql-hackers@postgresql.org
Subject: Re: SlabCheck leaks memory into TopMemoryContext
Date: Fri, 17 Jan 2020 15:34:50 +0100
Message-ID: <20200117143450.3txuxa4t4hw7iuay@development> (raw)
In-Reply-To: <20200116170432.gkpxd5xxhyodekw7@development>
References: <20200116044119.g45f7pmgz4jmodxj@alap3.anarazel.de>
<23952.1579151393@sss.pgh.pa.us>
<20200116061732.vvpyexenaortpu5y@alap3.anarazel.de>
<27213.1579155900@sss.pgh.pa.us>
<20200116064143.opcu2vhcktddpzbh@alap3.anarazel.de>
<19743.1579188421@sss.pgh.pa.us>
<20200116162500.pcgxmykirm677mt6@development>
<563.1579193014@sss.pgh.pa.us>
<20200116170432.gkpxd5xxhyodekw7@development>
On Thu, Jan 16, 2020 at 06:04:32PM +0100, Tomas Vondra wrote:
>On Thu, Jan 16, 2020 at 11:43:34AM -0500, Tom Lane wrote:
>>Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
>>>The attached fix should do the trick - it pre-allocates the space when
>>>creating the context. There is a bit of complexity because we want to
>>>allocate the space as part of the context header, but nothin too bad. We
>>>might optimize it a bit by using a regular bitmap (instead of just an
>>>array of bools), but I haven't done that.
>>
>>Hmm ... so if this is an array of bools, why isn't it declared bool*
>>rather than char* ? (Pre-existing ugliness, sure, but we might as
>>well fix it while we're here. Especially since you used sizeof(bool)
>>in the space calculation.)
>>
>
>True. Will fix.
>
>>I agree that maxaligning the start point of the array is pointless.
>>
>>I'd write "free chunks in a block" not "free chunks on a block",
>>the latter seems rather shaky English. But that's getting picky.
>>
>>LGTM otherwise.
>>
>
>OK. Barring objections I'll push and backpatch this later today.
>
I've pushed and backpatched this all the back back to 10.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, tgl@sss.pgh.pa.us, andres@anarazel.de, tv@fuzzy.cz
Subject: Re: SlabCheck leaks memory into TopMemoryContext
In-Reply-To: <20200117143450.3txuxa4t4hw7iuay@development>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox