Memory leak in multipathd.
A message that is not in the archive (sent off-list or not yet received): 4F2CC79CDB05B844AEEA72F36255835403FD4EC3@bunker.inside.abhaisystems.com
Ok, to my knowledge Konrad plugged this one in December upstream :
commit d0d98bc348b69d873841b10dd9a1c73af305f0fd
Author: Konrad Rzeszutek <[email protected]> Date: Wed Dec 17 23:19:19 2008 +0100
Thank you for the report Hari. But know that there are very few tarball releases, so upstream is really the git HEAD. This is what you should check and see if the bugs you report are already fixed.
Best regards,
cvaroqui
----- Mail Original -----
De: "Harikrishnan Padidakul" <[email protected]>
À: "christophe varoqui" <[email protected]>
Cc: [email protected]
Envoyé: Mardi 12 Mai 2009 07h42:36 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: RE: Memory leak in multipathd.
I am reporting memory leak for the code multipath-tools-0.4.7.rhel5.13 downloaded from rhel and multipath-tools-0.4.8. vector_free() will not free the mpp's allocated by dm_get_maps(). Here we need to call free_multipath() Below is by fix:
dm_get_name(char *uuid, char *type, char *name)
{
vector vec;
struct multipath *mpp;
int ret;
int i;
vec = vector_alloc();
if (!vec)
return 0;
if (dm_get_maps(vec, type)) {vector_free(vec);
return 0;
}vector_foreach_slot(vec, mpp, i) {
if (!strcmp(uuid, mpp->wwid)) {strcpy(name, mpp->alias);
ret = 1;
goto found;
}
}
ret = 0;
found:vector_foreach_slot(vec, mpp, i) {free_multipath(mpp, KEEP_PATHS);
}vector_free(vec);
return ret;
}
Thanks,
Hari
From: [email protected] [mailto:[email protected]]
Sent: Tue 5/12/2009 3:13 AM
To: Harikrishnan Padidakul
Cc: [email protected]
Subject: Re: Memory leak in multipathd.
Quoted 4 lines
I was testing multipath with more than 3000paths, I found multipathd using around 2.3GB of memory.
After closely digging the code, I found In functiondm_get_name()we are callingdm_get_maps()which will allocate memory for mmp. But we are not freeing the same after search is done.
I have made a fix by callingfree_multipath(),w ith this fix multipathd is using less than 200MB of memory.
Hi Hari,
are you reporting on the upstream multipath-tools code ? I already see multipath vector freeing there ...