Re: DSA failed to allocate memory - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: DSA failed to allocate memory
Date
Msg-id CA+hUKGKvSEgXJyJPmD7tHDy+AwYeFwA+TdX1ferdOSQRswLmFw@mail.gmail.com
Whole thread Raw
In response to Re: DSA failed to allocate memory  (Dongming Liu <ldming101@gmail.com>)
Responses Re: DSA failed to allocate memory  (Dongming Liu <ldming101@gmail.com>)
Re: DSA failed to allocate memory  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Mar 28, 2022 at 8:14 PM Dongming Liu <ldming101@gmail.com> wrote:
> On Fri, Mar 18, 2022 at 3:30 PM Dongming Liu <ldming101@gmail.com> wrote:
>> I'm trying to move segments into appropriate bins in dsa_free().
>> In 0001-Re-bin-segment-when-dsa-memory-is-freed.patch, I extract
>> the re-bin segment logic into a separate function called rebin_segment,
>> call it to move the segment to the appropriate bin when dsa memory is
>> freed. Otherwise, when allocating memory, due to the segment with
>> enough contiguous pages is in a smaller bin, a suitable segment
>> may not be found to allocate memory.
>>
>> Fot test, I port the test_dsa patch from [1] and add an OOM case to
>> test memory allocation until OOM, free and then allocation, compare
>> the number of allocated memory before and after.

Hi Dongming,

Thanks for the report, and for working on the fix.  Can you please
create a commitfest entry (if you haven't already)?  I plan to look at
this soon, after the code freeze.

Are you proposing that the test_dsa module should be added to the
tree?  If so, some trivial observations: "#ifndef
HAVE_INT64_TIMESTAMP" isn't needed anymore (see commit b6aa17e0, which
is in all supported branches), the year should be updated, and we use
size_t instead of Size in new code.



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: Allow file inclusion in pg_hba and pg_ident files
Next
From: Alvaro Herrera
Date:
Subject: Re: [HACKERS] WIP aPatch: Pgbench Serialization and deadlock errors