in reply to
Massive Memory Leak
That looks like every iteration you're preparing a query.
Perhaps pre-declaring it and using placeholders will help?
Comment on
Re: Massive Memory Leak
In Section
Seekers of Perl Wisdom