RE: [HACKERS] vacuum process size

From: Mike Mascari <mascarim(at)yahoo(dot)com>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: RE: [HACKERS] vacuum process size
Date: 1999-08-20 09:41:19
Message-ID: 19990820094119.20922.rocketmail@web103.yahoomail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At the very least, couldn't vc_vpinsert() double
vpl->vpl_num_pages whenever vpl->vpl_num_pages
needs to be expanded instead of expanding linearly
by PG_NPAGEDESC, or by the original 100?

Mike Mascari
(mascarim(at)yahoo(dot)com)

--- Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp> wrote:
> Hi all,
>
> I found the following comment in utils/mmgr/aset.c.
> The high memory usage of big vacuum is probably
> caused by this
> change.
> Calling repalloc() many times with its size
> parameter increasing
> would need large amount of memory.
>
> Should vacuum call realloc() directly ?
> Or should AllocSet..() be changed ?
>
> Comments ?
>
> * NOTE:
> * This is a new (Feb. 05, 1999) implementation
> of the allocation set
> * routines. AllocSet...() does not use
> OrderedSet...() any more.
> * Instead it manages allocations in a block
> pool by itself, combining
> * many small allocations in a few bigger
> blocks. AllocSetFree() does
> * never free() memory really. It just add's
> the free'd area to some
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> * list for later reuse by AllocSetAlloc(). All
> memory blocks are
> free()'d
>
> Regards.
>
> Hiroshi Inoue
> Inoue(at)tpf(dot)co(dot)jp

> > *** vacuum.c.orig Sat Jul 3 09:32:40 1999
> > --- vacuum.c Thu Aug 19 17:34:18 1999
> > ***************
> > *** 2519,2530 ****
> > static void
> > vc_vpinsert(VPageList vpl, VPageDescr vpnew)
> > {
> >
> > /* allocate a VPageDescr entry if needed */
> > if (vpl->vpl_num_pages == 0)
> > ! vpl->vpl_pagedesc = (VPageDescr *) palloc(100
> *
> > sizeof(VPageDescr));
> > ! else if (vpl->vpl_num_pages % 100 == 0)
> > ! vpl->vpl_pagedesc = (VPageDescr *)
> > repalloc(vpl->vpl_pagedesc, (vpl->vpl_num_pages +
> 100) *
> > sizeof(VPageDescr));
> > vpl->vpl_pagedesc[vpl->vpl_num_pages] = vpnew;
> > (vpl->vpl_num_pages)++;
> >
> > --- 2519,2531 ----
> > static void
> > vc_vpinsert(VPageList vpl, VPageDescr vpnew)
> > {
> > + #define PG_NPAGEDESC 1000
> >
> > /* allocate a VPageDescr entry if needed */
> > if (vpl->vpl_num_pages == 0)
> > ! vpl->vpl_pagedesc = (VPageDescr *)
> > palloc(PG_NPAGEDESC * sizeof(VPageDescr));
> > ! else if (vpl->vpl_num_pages % PG_NPAGEDESC ==
> 0)
> > ! vpl->vpl_pagedesc = (VPageDescr *)
> > repalloc(vpl->vpl_pagedesc, (vpl->vpl_num_pages +
> PG_NPAGEDESC) *
> > sizeof(VPageDescr));
> > vpl->vpl_pagedesc[vpl->vpl_num_pages] = vpnew;
> > (vpl->vpl_num_pages)++;
> >

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ansley, Michael 1999-08-20 10:32:00 RE: [HACKERS] Postgres' lexer
Previous Message Leon 1999-08-20 09:36:20 Re: [HACKERS] Postgres' lexer