|
From: Dennis L. <pla...@in...> - 2005-08-26 07:50:04
|
At 03:21 26.08.2005, Christian Parpart wrote: Does the number of blocks increase during run ? I remember my glibc having a little memleak in gethostbyname, and another case were some static buffer was allocated, but not freed at program end, but that was totally ok as it was only a few bytes. There was also a part in the function where an old buffer was freed() when the function was called again, so if the number of reachable blocks does not increase, theres no reason to worry about. Btw, to all others in the list, can I somehow print the address of the memory still reachable/leaked ? It would help to track it down when writing memory addresses of various internal stuff.. >==16981== 84 bytes in 3 blocks are still reachable in loss record 11 of 28 >==16981== at 0x1B9008C1: malloc (vg_replace_malloc.c:149) > >Interestingly, the man-page doesn't tell me anything about >gethostbyname_r() to be free()d afterwards. So, I don't >understand in why it leaks there. Thats right, you are not supposed to free() anything the function gives you. This looks like a MySQL bug, but again the question is, if the number of blocks increases, since this is a still reachable memory, so mysql has still a pointer to it, and this might just be some internal buffer. otherwise, you might want to try to mail the developers on their mailinglist... >And this is another odd one: > >==16981== 4088 bytes in 1 blocks are still reachable in loss record 22 of 28 >==16981== at 0x1B9008C1: malloc (vg_replace_malloc.c:149) >I'm pretty sure, that mysql_close() gets invoked everywhere, but somehow, >libmysqlclient leaks here a memory block regarding its connection >establishment. I think its not a *real* leak since the app still has a pointer to it, it could be as well some internal buffer. Usually only those are leaks where valgrind says they are definitely or possibly lost. Reachable memory is generally only then a leak when the number of allocated blocks increases during runtime. But of course, to every rule, there is an exception... greets Dennis Carpe quod tibi datum est |