RE: [HACKERS] vacuum process size - Mailing list pgsql-hackers
From | Mike Mascari |
---|---|
Subject | RE: [HACKERS] vacuum process size |
Date | |
Msg-id | 19990820094119.20922.rocketmail@web103.yahoomail.com Whole thread Raw |
Responses |
Re: [HACKERS] vacuum process size
Re: [HACKERS] vacuum process size |
List | 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@yahoo.com) --- Hiroshi Inoue <Inoue@tpf.co.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@tpf.co.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
pgsql-hackers by date: