Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Centos 5 specific DBI memory leak

by Burak (Chaplain)
on Aug 14, 2008 at 08:07 UTC ( [id://704304]=note: print w/replies, xml ) Need Help??


in reply to Re: Centos 5 specific DBI memory leak
in thread Centos 5 specific DBI memory leak

Using finish() after fetching the values can be good but I don't think this is necessary here since all data is fetched and it must finish automatically.

Btw, I seem to experience some weird behaviour with CentOS5 too, but since all perls are non-threaded I can't confirm this DBI issue...

Update: on a second thought, I think the definiton of $sth can cause problems since it becomes a static var. I don't see any reason to define it outside the sub. So, it is better to define it inside the sub...
  • Comment on Re^2: Centos 5 specific DBI memory leak

Replies are listed 'Best First'.
Re^3: Centos 5 specific DBI memory leak
by Krambambuli (Curate) on Aug 14, 2008 at 08:43 UTC
    Making $sth static is intentional.

    It allows to prepare() the statement only once, even if using it afterwards billions of times.

    Defining it in the sub would imply a heavy performance penalty, even if it would circumvent the problem faced now - but thank you anyway.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://704304]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2024-04-26 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found