Re: Potential dbi memory leak.

2015-05-31 Thread Steve Cookson
Hi Tim, Sorry to prolong this. On 28/05/15 08:58, Tim Bunce wrote: When a new handle is created the DBI simply pushes a weak reference to the handle onto the end of the ChildHandles array. Because it's a weak reference it doesn't interfere with the handle getting destroyed when the last (non

Re: Potential dbi memory leak.

2015-05-28 Thread Tim Bunce
On Thu, May 28, 2015 at 03:59:51PM +1200, Duncan McEwan wrote: > On Tue, 26 May 2015 14:13:05 +0100 Tim Bunce wrote: > > > I've added this as a note: > > > > Note that the ChildHandles array holds weak references and that 'from > > time to time' the old slots get freed up. This isn't a l

Re: Potential dbi memory leak.

2015-05-28 Thread Steve Cookson
I haven't tried it but you could probably modify the code I posted to test it. With the statement handle after 120(?) loops of apparent memory leak +1, there is a correction of -119. Good luck. Steve. On 28 May 2015 05:00, "Duncan McEwan" wrote: > Apologies for butting in on this thread, but I

Re: Potential dbi memory leak.

2015-05-27 Thread Duncan McEwan
Apologies for butting in on this thread, but I saw the following response from Tim recently and it made me wonder ... On Tue, 26 May 2015 14:13:05 +0100 Tim Bunce wrote: > I've added this as a note: > > Note that the ChildHandles array holds weak references and that 'from > time to time

Re: Potential dbi memory leak.

2015-05-26 Thread Steve Cookson - gmail
Hi Again On 26/05/15 10:13, Tim Bunce wrote: Note that the ChildHandles array holds weak references and that 'from time to time' the old slots get freed up. This isn't a leak, it just appears to be if you're not familiar with the caching that DBI does internally. You can rest

Re: Potential dbi memory leak.

2015-05-26 Thread Steve Cookson - gmail
Hi Tim, Oh yes for (1..500) does exactly that. Thank you. No memory leak at all! Regards Steve. On 26/05/15 10:13, Tim Bunce wrote: I've added this as a note: Note that the ChildHandles array holds weak references and that 'from time to time' the old slots get freed up. This isn'

Re: Potential dbi memory leak.

2015-05-26 Thread Tim Bunce
I've added this as a note: Note that the ChildHandles array holds weak references and that 'from time to time' the old slots get freed up. This isn't a leak, it just appears to be if you're not familiar with the caching that DBI does internally. You can rest assured that if the DBI

Re: Potential dbi memory leak.

2015-05-26 Thread Steve Cookson - gmail
It seems to be further documented here, together with a solution: http://stackoverflow.com/questions/13338308/perl-dbi-memory-leak, But the solution does not seem to be reliable. Sometimes it works sometimes not. I'll update you when I know more. Regards, Steve. On 26/05/15 07:07, Steve C

Potential dbi memory leak.

2015-05-26 Thread Steve Cookson - gmail
Hi Guys, You may have seen part of this post on PerlMonks. If so apologies for the duplication. This started off as a general search for leaks in my code, and resulted in a few hits, one of which was attached to every database access. A simple "select ATT_RECORD_NAME_TXT from TBL_TEST; " r