Skip to contentSkip to conversation

Fix 'memory leak' in xend

PATCH New Jim Fehlig 1 participant 1 message Sep 10, 2007

lore
Share & tools
lore

Jim Fehlig

author
#0 lore raw

PATCH 1/1 Fix 'memory leak' in xend

I found that xend's memory usage grows considerably when running a script such as

while true; do xm new foo ; sleep 2s; xm delete foo ; sleep 2s; done

XendAPIStore maintains a list of class instances and in the case of new/create operation, an associated VMMetrics object is stashed in the list but never removed on delete/shutdown. This patch removes the instance by invoking XendBase.destroy() method.

tools/python/xen/xend/XendDomain.py +1 -0
diff -r 9071521d4864 tools/python/xen/xend/XendDomain.py
@@ -1088,6 +1088,7 @@ class XendDomain:
         log.info("Domain %s (%s) deleted." %
                  (dominfo.getName(), dominfo.info.get('uuid')))
                 
+        dominfo.metrics.destroy()
         self._managed_domain_unregister(dominfo)
         self._remove_domain(dominfo)
         XendDevices.destroy_device_state(dominfo)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel