Re: plperl doesn't release memory

From: "GIROIRE Nicolas (COFRAMI)" <nicolas(dot)giroire(at)airbus(dot)com>
To: "'pgsql-general-owner(at)postgresql(dot)org'" <pgsql-general-owner(at)postgresql(dot)org>
Subject: Re: plperl doesn't release memory
Date: 2005-03-31 11:32:42
Message-ID: 1904E3EB39448246A7ECB76DF34A70B0036A4047@TOCOMEXC03
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The function is a little big, so i put it in an enclosure file.

The function write regularly in a file to empty the variable theClob. The
fact the written is done all 100000 has no signification, it's just to empty
theClob before it's full.

We have a look at the memory and it never decreases.
If you have question about code, tell me ?
This code is correct because it functions over a little example.

Best regards

COFRAMI
Nicolas Giroire
on behalf of AIRBUS France
for In Flight & Ground Information Services - Development
Phone : +33 (0)5 67 19 98 74
Mailto:nicolas(dot)giroire(at)airbus(dot)com

-----Message d'origine-----
De : Sean Davis [mailto:sdavis2(at)mail(dot)nih(dot)gov]
Envoyé : jeudi 31 mars 2005 13:15
À : GIROIRE Nicolas (COFRAMI)
Objet : Re: [GENERAL] plperl doesn't release memory

On Mar 31, 2005, at 1:38 AM, GIROIRE Nicolas (COFRAMI) wrote:

> Hi,
> I work with William.
>
> In fact, we have already done the procedure in pl/pgsql but it is too
> slow and we use array which are native in perl.
> The procedure is recursive, and use request on postgreSQL.
> According to the evolution of memory use, it seems that no memory is
> free. I think that comes from the fact we have a recursive procedure.
>
> The execution of the procedure take 3 hours and finishes already by an
> out of memory.
>
> Can we oblige pl/perl to free memory for variable ?
> Or can we configure postgresql to accept this rise in load ?
> Or another idea ?
>
> When the procedure crash, postgresql use 280 MB of memory and 2 Go of
> virtual memory and on the server we have a message "Windows try to
> increase virtual memory".
>

Perhaps, if the function isn't too big, you could post it so that we
might see what you are trying to do. As other folks have mentioned, as
variables go out of scope, the memory is freed. However, if they don't
go out of scope, they won't be freed until the end of the function. My
concern, like that of others, is that your variables are not going out
of scope (or being undefined explicitly). The only way to know is to
go through the code.

Sean

This mail has originated outside your organization,
either from an external partner or the Global Internet.
Keep this in mind if you answer this message.

Attachment Content-Type Size
src.txt text/plain 5.7 KB

Browse pgsql-general by date

  From Date Subject
Next Message Joe Maldonado 2005-03-31 13:29:40 truncate/create slowness
Previous Message Nageshwar Rao 2005-03-31 10:40:04 not able to connect to Database