CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: DBI:
Memory leak on making connection

 



advent
New User

Jun 30, 2009, 10:27 AM

Post #1 of 2 (3717 views)
Memory leak on making connection Can't Post

I am running into a problem where it appears there's a memory leak when I open a database connection with DBI:ODBC. I am connecting to Oracle database. I am uncertain whether it's a memory leak, or each database session is being cached and never released. If so, how would I release it properly. For my purpose I am making thousands of connections per hour.

I used the following simple program to test and monitor the memory usage goes up:

---------------------------------
#!/usr/bin/perl -w
use strict;
use DBI;
use Win32::API;

sub test {
for ($count=0; $count < 2000; $count++) {
my $dbh = DBI->connect('dbi:ODBC:dbname', 'user', 'pw') or print "Connect failed!\n";
$rc = $dbh->disconnect;
}
}

test();
---------------------------------

Thanks in advance,
Jet


1arryb
User

Jul 6, 2009, 12:21 PM

Post #2 of 2 (3652 views)
Re: [advent] Memory leak on making connection [In reply to] Can't Post

Hi advent,

I deleted my previous reply, because I hadn't understood your issue.

Looking around on the net, I read some indications that the problem may be in oracle's ODBC driver. Upgrading or changing the driver (The Microsoft ODBC driver apparently doesn't have this problem, although it's slower) may fix your issue. However, do you really have thousands of databases to connect to?

Cheers,

Larry

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives