Re: SlabCheck leaks memory into TopMemoryContext - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SlabCheck leaks memory into TopMemoryContext
Date
Msg-id 23952.1579151393@sss.pgh.pa.us
Whole thread Raw
In response to SlabCheck leaks memory into TopMemoryContext  (Andres Freund <andres@anarazel.de>)
Responses Re: SlabCheck leaks memory into TopMemoryContext
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I just noticed that having a slab context around in an assertion build
> leads to performance degrading and memory usage going up. A bit of
> poking revealed that SlabCheck() doesn't free the freechunks it
> allocates.

> It's on its own obviously trivial to fix.

It seems like having a context check function do new allocations
is something to be avoided in the first place.  It's basically assuming
that the memory management mechanism is sane, which makes the whole thing
fundamentally circular, even if it's relying on some other context to be
sane.  Is there a way to do the checking without extra allocations?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Amit Khandekar
Date:
Subject: Re: Minimal logical decoding on standbys
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Block level parallel vacuum