From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jim Fehlig Subject: [PATCH] Fix 'memory leak' in xend Date: Mon, 10 Sep 2007 14:52:33 -0600 Message-ID: <46E5AE91.1090402@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090406030800080005030802" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------090406030800080005030802 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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. Signed-off-by: Jim Fehlig --------------090406030800080005030802 Content-Type: text/x-patch; name="xend_mem_leak.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xend_mem_leak.diff" diff -r 9071521d4864 tools/python/xen/xend/XendDomain.py --- a/tools/python/xen/xend/XendDomain.py Fri Sep 07 11:39:10 2007 +0100 +++ b/tools/python/xen/xend/XendDomain.py Mon Sep 10 11:35:59 2007 -0600 @@ -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) --------------090406030800080005030802 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------090406030800080005030802--