Re: Workaround for memory leak problem -- comments?
Posted in 1993
Topics: General Discussion
pwalden@hpcc01.corp.hp.com (Philip Walden) writes: >I found that if a child did not exec a new process, that the database >connection was closed when the child did an exit. The work around >was to do an exec with "/bin/sh -C exit". This didn't happened to me. The child process in my program does indeed call exit() upon completing its task, and the parent process was able to carry on accessing the database (and to fork more child processes later). However, I did have to modify the declaration of a C++ object (the one that opens the database in the ctor and closes it in the destructor) from a static variable to an automatic variable, so that its destructor will not get called when the child process calls exit(). >I suspect that informix calls atexit() to register the database close. -- --------------------------------------------------------------------- Chee-Meng Low (cmlow@iti.gov.sg) (fax: 65-777-3043) Information Technology Institute, Singapore >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<