Re: plperl doesn't release memory

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: plperl doesn't release memory
Дата
Msg-id 20050331082524.GC30965@svana.org
обсуждение исходный текст
Ответ на Re: plperl doesn't release memory  ("GIROIRE Nicolas (COFRAMI)" <nicolas.giroire@airbus.com>)
Список pgsql-general
On Thu, Mar 31, 2005 at 08:38:09AM +0200, GIROIRE Nicolas (COFRAMI) wrote:
> Can we oblige pl/perl to free memory for variable ?
> Or can we configure postgresql to accept this rise in load ?
> Or another idea ?


Perl uses reference counting, so as long as a string is visibile
anywhere (remember closures), it stays around and disappears as soon as
it's unreferenced.

If you have large strings or arrays you don't need, maybe you need to
explicitly undef them. Using shift and pop on arrays doesn't copy the
element for example. Make sure you're using my on all your variables so
they are cleared on exiting a function.

Also, this doesn't work on circular references, so if you build
structures like that you'll need to explicitly break the chain.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Вложения

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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Catch of ERROR in PLPGSQL
Следующее
От: "GIROIRE Nicolas (COFRAMI)"
Дата:
Сообщение: Re: plperl doesn't release memory