Re: Sort memory not being released

Поиск
Список
Период
Сортировка
От Sean Chittenden
Тема Re: Sort memory not being released
Дата
Msg-id 20030616215855.GE97131@perrin.int.nxad.com
обсуждение исходный текст
Ответ на Re: Sort memory not being released  ("Jim C. Nasby" <jim@nasby.net>)
Ответы Re: Sort memory not being released  (Martijn van Oosterhout <kleptog@svana.org>)
Список pgsql-general
> > > It appears that after a pgsql backend uses memory for sort, it doesn't
> > > get released again, at least on solaris. IE:
> >
> > That's true on many Unixen --- malloc'd space is never released back to
> > the OS until the process dies.  Not much we can do about it.  If you're
> > concerned, start a fresh session, or use another Unix (or at least a
> > better malloc package).
>
> Holy ugly batman...
>
> This is on solaris; is there a different/better malloc I could use?

See if there's an madvise(2) call on Slowaris, specifically, look for
something akin to (taken from FreeBSD):

     MADV_FREE        Gives the VM system the freedom to free pages, and tells
                      the system that information in the specified page range
                      is no longer important.  This is an efficient way of
                      allowing malloc(3) to free pages anywhere in the address
                      space, while keeping the address space valid.  The next
                      time that the page is referenced, the page might be
                      demand zeroed, or might contain the data that was there
                      before the MADV_FREE call.  References made to that
                      address space range will not make the VM system page the
                      information back in from backing store until the page is
                      modified again.

That'll allow data that's malloc'ed to be reused by the OS.  If there
is such a call, it might be prudent to stick one in the sort code just
before or after the relevant free() call.  -sc

--
Sean Chittenden

В списке pgsql-general по дате отправления:

Предыдущее
От: "scott.marlowe"
Дата:
Сообщение: Re: RE : full featured alter table?
Следующее
От: Dennis Gearon
Дата:
Сообщение: Re: RE : full featured alter table?