Re: Make MemoryContextMemAllocated() more precise

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: Robert Haas <robertmhaas@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>, Tomas Vondra <tomas.vondra@postgresql.org>
Date: 2020-03-19T19:44:44Z
Lists: pgsql-hackers
On Thu, 2020-03-19 at 15:26 -0400, Robert Haas wrote:
> Well, the issue is, if I understand correctly, that this means that
> MemoryContextStats() might now report a smaller amount of memory than
> what we actually allocated from the operating system. That seems like
> it might lead someone trying to figure out where a backend is leaking
> memory to erroneous conclusions.

MemoryContextStats() was unaffected by my now-reverted change.

Regards,
	Jeff Davis





Commits

  1. Create memory context for HashAgg with a reasonable maxBlockSize.

  2. Specialize MemoryContextMemAllocated().