Re: Sort memory not being released

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Sort memory not being released
Дата
Msg-id 20030618001853.GC729@svana.org
обсуждение исходный текст
Ответ на Re: Sort memory not being released  (Sean Chittenden <sean@chittenden.org>)
Список pgsql-general
On Tue, Jun 17, 2003 at 10:02:07AM -0700, Sean Chittenden wrote:
> For long running servers and processes that grow quite large when
> processing something, but you'd like to have a small foot print when
> not processing data, this is what I have to do as a chump defrag
> routine.  Works well for platforms that have a halfway decent
> malloc().  Another option is to mmap() private anonymous regions,
> though I haven't don this for anything huge yet as someone reported
> being able to mmap() less than they were able to malloc()... something
> I need to test.

Look at the process memory layout. On Linux you get stack+heap is limited to
2GB. To access the rest you need to mmap(). This would vary depending on the
OS. IMHO glibc's approach (use mmap() for large allocations) is a good one
since the sortmems will generally be mmap()ed (at least they were in my
quick test last night.

As Tom pointed out, some study into memory framentation would be useful.

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
>   - Samuel P. Huntington

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: EFFECTIVE_CACHE_SIZE
Следующее
От: Ursula Lee
Дата:
Сообщение: How to convert Oracle database to Postgresql.