From: Michael Widenius Date: April 17 1999 7:12am Subject: Re: Memory leaking like a sieve in mysql client api. List-Archive: http://lists.mysql.com/mysql/1977 Message-Id: <14104.13217.338744.721581@monty.pp.sci.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit sfrog> how about setting: mysql-> free_me = 1; sfrog> before mysql_close() is called. would that guarantee the mysql is purged sfrog> when mysql_close() is issued ? i am having a similar problem with sfrog> mysql+apache. sfrog> on apache, one must register a cleanup (free()) for a later sfrog> time and seems mysql_close() is not releasing all the allocated sfrog> mem. Hi! If you are using mysql_init() to alloc the MYSQL structure, mysql_close() should deallocate everything. If anyone can prove otherwise, please mail any complete test program directly to me and I will fix this at once! Regards, Monty PS: Note that MySQL 3.21 doesn't have mysql_init(); In MySQL 3.21 one should instead call mysql_connect() or mysql_real_connect() with NULL as the first argument. This also works in MySQL 3.22, even if mysql_init() is the preferred way to do this!