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;


Thanks in advance,