From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio M. Di Nitto Date: Mon, 28 Feb 2011 05:48:47 +0100 Subject: [Cluster-devel] [PATCH] config: stop leaking memory on config reload In-Reply-To: <20110225165501.GW10920@redhat.com> References: <1298556572-32085-1-git-send-email-fdinitto@redhat.com> <20110225165501.GW10920@redhat.com> Message-ID: <4D6B292F.8080100@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On 02/25/2011 05:55 PM, Lon Hohberger wrote: > On Thu, Feb 24, 2011 at 03:09:32PM +0100, Fabio M. Di Nitto wrote: >> Resolves: rhbz#680155 > > ACK, but seriously, a function called "xmlCleanupParser()" shouldn't > leak memory ... I think the problem is triggered by the fact that initial load of config is done in the main thread, while subsequent reloads are done in another thread. libxml2 is said to be thread friendly only under certain circumstances and it's not completely tested for it. The documentation does mention that and since we don't really have a need to use the whole thread code here, let's take the easy approach. In my tests, where i was calling only xmlCleanupParser, it was not leaking at all. The leak happens only when there is an xmlParseFile and xmlFreeDoc associated with it. Weird but well.... Fabio