[unixODBC-support] Memory leakage induced on changing development platform

SEPS seps at wanadoo.es
Thu Oct 18 11:53:40 BST 2012

Hi all,

I've having a bit of a problem which I'd appreciate any insight into.


I've been using unixODBC for a couple of years with good results (and
Windows ODBC for close to 15 years). I've ported a DB intensive app from
Windows/SQLServer to linux/Oracle. In large part it was a major rewrite but
I stayed with ODBC to be able to port that code more or less directly.
Development started over 2 years ago and the app has been running fine on
our development systems (32-bit version of openSUSE where the unixODBC
version is 2.2.12-203.1-i586 and the oracle driver is and
also two diferent environments on our client's systems (64-bit SLES).

I'm migrating my development systems to 64-bit. I've installed openSUSE 12.2
with unixODBC 2.2.12-217.1.2-x86_64 from an openSUSE repository and the
oracle instant client version from oracle (tired an
earlier version also).


The problem is that my proceses are eating up memory at a rate of 4-8k every
time a statement is executed. I've traced it through in debug and it appears
as if unixODBC is freeing the resouces asociated with the statement handle
but the memory usage just keeps increasing. My app polls the DB at an
interval of every 3-5 seconds checking for some updates. It usually returns
an empty cursor so it must be something associated with the statement
handle. I preserve my environment and connection handles managing my own
pool and usually just allocate and drop statement handles as needed from my
available pool connections.


As I've mentioned, there has been nothing near similar neither on my 32-bit
development system nor on the client's systems. I've had my processes
running non-stop during weeks and they never have leaked memory in this way
(we promptly investigate and correct any of our coding issues causing memory

I've also confirmed that isql shows the same effects. I don't know the isql
internals but with every query I launch the isql memory usage goes up from
4-8k. I've exercised it with several hundred queries and the memory usage
just keeps growing until I quit the program.

I've exercised a good portion of the functionality of my app and everything
else looks like it works as designed and built. I could limp along for a
while restarting my processes when the memory usage gets extreme but I'd
like to find a permanent fix as soon as possible.

Glad to provide any other details for those interested.

Bill Schlegelmilch

More information about the unixODBC-support mailing list