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;

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?