Re: Memory Accounting
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Jeff Davis <pgsql@j-davis.com>,
Melanie Plageman <melanieplageman@gmail.com>,
Soumyadeep Chakraborty <sochakraborty@pivotal.io>,
Robert Haas <robertmhaas@gmail.com>,
Pg Hackers <pgsql-hackers@postgresql.org>, soumyadeep2007@gmail.com
Date: 2019-10-04T15:41:36Z
Lists: pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes: > On Fri, Oct 04, 2019 at 12:36:01AM -0400, Tom Lane wrote: >> What I think is happening is that c477f3e449 allowed this bit in >> AllocSetRealloc: >> context->mem_allocated += blksize - oldblksize; >> to be executed in situations where blksize < oldblksize, where before >> that was not possible. >> ... >> (I'm not quite sure why we're not seeing this failure on *all* the >> 32-bit machines; maybe there's some other factor involved?) > Interesting failure mode (especially that it does *not* fail on some > 32-bit machines). Just to make things even more mysterious, prairiedog finally showed the Assert failure on its fourth run with c477f3e449 included: https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=prairiedog&dt=2019-10-04%2012%3A35%3A41 It's also now apparent that lapwing and locust were failing only sometimes, as well. I totally don't understand why that failure would've been only partially reproducible. Maybe we should dig a bit harder, rather than just deciding that we fixed it. regards, tom lane
Commits
-
Change MemoryContextMemAllocated to return Size
- 36425ece5d6c 13.0 landed
-
Use Size instead of int64 to track allocated memory
- f2369bc610a1 13.0 landed
-
Add transparent block-level memory accounting
- 5dd7fc151946 13.0 landed
-
Change the way pre-reading in external sort's merge phase works.
- e94568ecc10f 10.0 cited
-
Improve memory management for external sorts.
- 0011c0091e88 9.6.0 cited
-
In array_agg(), don't create a new context for every group.
- b419865a814a 9.5.0 cited