Re: Memory Accounting
Tomas Vondra <tomas.vondra@2ndquadrant.com>
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
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-04T14:29:03Z
Lists: pgsql-hackers
On Fri, Oct 04, 2019 at 10:26:44AM +0200, Tomas Vondra wrote: >On Fri, Oct 04, 2019 at 12:36:01AM -0400, Tom Lane wrote: >>I haven't chased down exactly what else would need to change. >>It might be that s/int64/Size/g throughout the patch is >>sufficient, but I haven't analyzed it. >> > >I think so too, but I'll take a closer look in the afternoon, unless you >beat me to it. > I've pushed a fix changing the type to Size, splitting the mem_allocated to two separate updates (to prevent any underflows in the subtraction). Hopefully this fixes the 32-bit machines ... regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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