Thanks for information, I will try that. I suppose it's in a C file code,
but which one ?

I have some memory leak in our application, I've reduced our code ( we have
a big loop with insert) so now I hve a little test code just with a
selectall_hashref but I don't have quantify this leak. If I have time to do
test today I will have this information this evening or last week.

rgds,

David

-----Original Message-----
From: Tim Bunce [mailto:[EMAIL PROTECTED]
Sent: jeudi 3 juillet 2003 22:11
To: Guillaume, David [CTF:8D60:EXCH]
Cc: '[EMAIL PROTECTED]'
Subject: Re: Memory leak in selectall_hashref suspected....


On Thu, Jul 03, 2003 at 02:05:22PM +0200, David Guillaume wrote:
> 
> The memory leak is in DBI.pm at the fetchall_hashref line 3:
>               my $names_hash = $sth->FETCH("${hash_key_name}_hash");

How did you isolate that?

Hoe big is the leak? (What amount per what action?)

> Someone, know where I can found the code for this FETCH method ? Is it
> depending of the used database ?
> Someone  can help me ??

Try changing the code near line 1479 from

        else
            hv_store(hv, name, SvCUR(sv), newSViv(i), 0);
to
        else {
            sv_2mortal(sv);
            hv_store(hv, name, SvCUR(sv), newSViv(i), 0);
        }

Please let me know if that helps.

Tim.

p.s. The line number may be a bit different.

> rgds,
> 
> David
> -----Original Message-----
> From: Guillaume, David [CTF:8D60:EXCH] 
> Sent: jeudi 3 juillet 2003 12:28
> To: '[EMAIL PROTECTED]'
> Subject: Memory leak in selectall_hashref suspected....
> 
> 
> Hi all,
> 
> I'm working in a project with perl and postgres database on a SUN server.
We
> work with the DBI v1.37 and we have a memory leak problem when we use the
> selecall_hashref method.
>  
> When I replace this method a while loop which return the same result (an
> hash ref with result query), I have not this memory leak. So I quite sure
> the problem is in this method, but I can't found really where.
>  
> Have you got any information about this ? I'm trying to investigate more
in
> the lib.
>  
> Rgds,
>  
> David

Reply via email to