On Thu, Mar 19, 2020 at 2:11 PM Tomas Vondra <tomas.von...@2ndquadrant.com> wrote: > My understanding is that this is really just an accounting issue, where > allocating a block would get us over the limit, which I suppose might be > an issue with low work_mem values.
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. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company