pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: Melanie Plageman <melanieplageman@gmail.com>
Cc: Soumyadeep Chakraborty <sochakraborty@pivotal.io>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Cc: soumyadeep2007@gmail.com
Subject: Re: Memory Accounting
Date: Fri, 04 Oct 2019 10:43:18 -0400
Message-ID: <11238.1570200198@sss.pgh.pa.us> (raw)
In-Reply-To: <0278d32083d051f165c75d605d9fd1a82a197ef8.camel@j-davis.com>
References: <CADwEdor2jZitB2P94on2LUAhdi0iRHv2WNseV3LJmJPenuuNpw@mail.gmail.com>
	<67f66d2fa39e35aef90093c74531a38dcd5c0f73.camel@j-davis.com>
	<CAAKRu_b2Qxr=GzE7thk8_=JDgYRnOssYBuqWdZ39R2+Heo=oQw@mail.gmail.com>
	<20190926192244.mk5ru6nkofo7am3h@development>
	<57780817877d4b40106b248b63261e21a7a56261.camel@j-davis.com>
	<20190928221249.mo2jrtlakingnc5e@development>
	<20190928222206.thidzeygazl7axhg@development>
	<392e034c1b674a1a58c217dc440ea6197081ccfa.camel@j-davis.com>
	<20191001021114.iimd77xgnstaww7j@development>
	<15151.1570163761@sss.pgh.pa.us>
	<20191004082644.wytixiukkm6ditlu@development>
	<0278d32083d051f165c75d605d9fd1a82a197ef8.camel@j-davis.com>

Jeff Davis <pgsql@j-davis.com> writes:
> On Fri, 2019-10-04 at 10:26 +0200, Tomas Vondra wrote:
>> Yeah, I think that's an oversight. Maybe there's a reason why Jeff
>> used int64, but I can't think of any.

> I had chosen a 64-bit value to account for the situation Tom mentioned:
> that, in theory, Size might not be large enough to represent all
> allocations in a memory context. Apparently, that theoretical situation
> is not worth being concerned about.

Well, you could also argue it the other way: maybe in our children's
time, int64 won't be as wide as Size.  (Yeah, I know that sounds
ridiculous, but needing pointers wider than 32 bits was a ridiculous
idea too when I started in this business.)

The committed fix seems OK to me except that I think you should've
also changed MemoryContextMemAllocated() to return Size.

			regards, tom lane





view thread (28+ messages)  latest in thread

Message-ID: <11238.1570200198@sss.pgh.pa.us>
Permalink:  ../11238.1570200198@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11238.1570200198@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql@j-davis.com, tomas.vondra@2ndquadrant.com, melanieplageman@gmail.com, sochakraborty@pivotal.io, robertmhaas@gmail.com, soumyadeep2007@gmail.com
  Subject: Re: Memory Accounting
  In-Reply-To: <11238.1570200198@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox