Memory leak?
Posted in 1999
Can anyone out there shed some light on what is going on here?
IDS 7.30.UC2
SCO UNIX
The applications that we right to connect to the database are connected for
weeks to months at a time (they would be connected longer if we were not
having the problem I'm about to explain). Over time the memory that these
sessions allocate grows to be quite large, and eventually cause the engine
to crash. I asked the application developers to check to see if there are
any cursors or prepared statements that aren't getting freed properly.
According to the developers everything is getting cleaned up in their
code.
I am wondering if Informix has a problem cleaning up allocated memory
properly. I modified one of the demo esql/c programs (included below)
included with IDS to check and see if this was a possibility. The program
prepares a statement, declares a cursor, opens the cursor, fetches some
rows, closes the cursor, frees the cursor, and then frees the prepared
statement. During the execution of the program I monitor memory usage of
the session through onstat -g ses.
Once the program connects to the database it's respective onstat -g ses
output is
session #RSAM total used
id user tty pid hostname threads memory memory
372 informix ttyp26 2834 beaker 1 32768 24216
After the program prepares the statement, declares the cursor, fetches
rows, frees the cursor, and frees the prepared statement the onstat -g ses
output is
session #RSAM total used
id user tty pid hostname threads memory memory
372 informix ttyp26 2834 beaker 1 40960 26196
What I want to know is why is this session using 1980 more bytes than
before when the session is in exactly the same state as it was when I first
connected to the database? Is this a memory leak?
Any help would be very cool. The code follows for anyone that is
interested.
Thanks,
Andrew Ford
Informix Database Administrator
Simplified Telesys
5000 Plaza on the Lake, Suite 170
Austin, TX 78746