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...
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.
| [reply] |
|