Workaround for memory leak problem -- comments?
Posted in 1993
Topics: General Discussion
Hi, We have an application using Informix EQSL/C on Unix. This application is meant to run continously for many weeks in a row. Currently, it is plagued by memory leaks due to dynamic SQL accesses (a known Informix bug) and as a result bogs down and crashes every so often due to memory exhaustion. This is not helped by our design/code, which besides maintaining a small set of cursors to be accessed throughout the application lifetime, also tends to create, use and discard many additional cursors on demand, at a rather fast pace (a consequence of our O.O. design). One quick solution we came up with is to fork out a new process every time the application needs to serve a major task. In this way, the cursors can be created and discarded in the child process, which is then killed upon completing the task and returning contol to the parent process. With this scheme, the memory leaks are confined to the short-lived child processes and is therefore never allowed to build up to any critical limit. My question is: Is it 'safe' to fork a process that is accessing Informix? Will Informix be confused by the presence of the same 'cursor' (descriptor) in both the child and parent process? Any comments will be appreciated. Thanks and regards, CheeMeng -- --------------------------------------------------------------------- Chee-Meng Low (cmlow@iti.gov.sg) (fax: 65-777-3043) Information Technology Institute, Singapore >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<