Skip to contentSkip to conversation

config: stop leaking memory on config reload

PATCH New Fabio M. Di Nitto 3 participants 4 messages Feb 24, 2011 – Feb 28, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 config: stop leaking memory on config reload

Resolves: rhbz#680155

---
 config/plugins/xml/config.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
config/plugins/xml/config.c +0 -2
index 1db23da..7dcf8ba 100644
@@ -142,7 +142,5 @@ fail:
 	if (doc)
 		xmlFreeDoc(doc);
 
-	xmlCleanupParser();
-
 	return err;
 }
Signature · 1 line
1.7.4
#1 lore raw

PATCH 1/1 config: stop leaking memory on config reload

Quoted 1 line · Fabio M. Di Nitto

Resolves: rhbz#680155

ACK, but seriously, a function called "xmlCleanupParser()" shouldn't leak memory ...

Signature · 1 line
Lon Hohberger - Red Hat, Inc.
#2 lore raw

PATCH 1/1 config: stop leaking memory on config reload

Quoted 5 lines · Lon Hohberger
Quoted 1 line · Fabio M. Di Nitto

Resolves: rhbz#680155

ACK, but seriously, a function called "xmlCleanupParser()" shouldn't leak memory ...

It's probably just sweeping it under the rug :P

Tim

Signature · 2 lines
Tim Serong <[email protected]>
Senior Clustering Engineer, OPS Engineering, Novell Inc.
#3 lore raw

PATCH 1/1 config: stop leaking memory on config reload

In reply to Lon Hohberger
Quoted 5 lines · Lon Hohberger
Quoted 1 line · Fabio M. Di Nitto

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