Re: plperl doesn't release memory

From: Harald Fuchs <use_reply_to(at)protecting(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: plperl doesn't release memory
Date: 2005-03-31 09:54:08
Message-ID: puhdiscf9b.fsf@srv.protecting.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In article <20050331082524(dot)GC30965(at)svana(dot)org>,
Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:

> 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.

... or use WeakRef.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nageshwar Rao 2005-03-31 10:40:04 not able to connect to Database
Previous Message Shaun Clements 2005-03-31 09:05:05 Re: Catch of ERROR in PLPGSQL