[unixODBC-dev] Memory leak in unixODBC?

Matthias Meier meier at fuh.de
Mon Sep 6 11:27:37 BST 2004


Nick Gorham schrieb:
> Matthias Meier wrote:
> 
>>  - or is it my programming fault?
>>
>> Hello!
>>
>> Im pretty new to [unix]ODBC so I wrote a simple function which 
>> connects to
>> an ODBC (Informix) database an selects one colum in one row.
>> If I put this function in a loop for 100 selects
>> I start with an program-memory size of 2.7 MB and end up with 8 MB!!
>>
>> (Yes, i know, opening and closing the connection isn't really good but 
>> it should work without loosing any memory)
>>
>> Any ideas? -thaks for help!
>>
> 
> Maybe down to the driver, I just repeated that with postgres, and its 
> not doing it.
> 
No change - it seems to be the CONNECTION-Handle.

> Maybe you could try only allocation the env once, do it outside the loop.
> 

Is there a (serious) problem to keep the connection open and exit() the programm without
closing the connection, and freeing the handles?



More information about the unixODBC-dev mailing list