11 messages in com.mysql.lists.bugsRE: Memory leak in client-library's m...
FromSent OnAttachments
Mikko Noromaa09 May 2002 10:54 
Sinisa Milivojevic10 May 2002 05:16 
Mikko Noromaa10 May 2002 07:22 
Sinisa Milivojevic10 May 2002 09:08 
Mikko Noromaa10 May 2002 09:51 
Sinisa Milivojevic10 May 2002 09:57 
Sinisa Milivojevic10 May 2002 10:08 
Venu10 May 2002 15:11 
Mikko Noromaa11 May 2002 08:06 
Michael Widenius15 May 2002 01:11 
Michael Widenius15 May 2002 01:45 
Subject:RE: Memory leak in client-library's mysql_init() and mysql_real_connect()
From:Michael Widenius (mon@mysql.com)
Date:05/15/2002 01:45:13 AM
List:com.mysql.lists.bugs

Hi!

"Mikko" == Mikko Noromaa <mik@nm-sol.com> writes:

Mikko> Hi,

<cut>

Mikko> - The problem only occurs with the statically linked mysqlclient.lib Mikko> library. It does not occur with the dynamically linked libmysql.lib/dll Mikko> library.

In this case there shouldn't be any behavior differences between static and dynamic libraries. In both cases the library will call mysql_init() to allocate memory for internal MySQL structures.

Mikko> - The problem with the statically linked library is probably that Mikko> my_end() is never called in it. At least I couldn't find any place where Mikko> my_end() would be called.

This function is never called directly. (As this should only need to be called just before application ends, there is no real need to call it).

I have now fixed in the MySQL 4.0.x source tree, my_end() will be called by mysql_server_end().

Mikko> - I tried adding the call to my_end() into my application. I didn't work Mikko> on first shot; I suspect that has something to do about not calling Mikko> my_thread_end(), but I didn't investigate this further. Anyway, my_end() Mikko> and my_thread_end() are undocumented.

In the 4.0 manual, we have documented that one needs to call mysql_thread_end() to free memory allocated by the current thread.

We have not fixed this in the 3.23 sources, but are concentrating on getting 4.0 out as a main release.

Regards, Monty