xen/20013-xend-memleak.patch
Charles Arnold 938967839e - bnc#491081 - Xen time goes backwards x3950M2
Patch for this bug plus additional upstream patches from Jan.
  19614-x86-emul-lldt-ltr.patch
  20026-ept-rwx-default.patch
  20031-x86-pmode-load-seg-retry.patch
  20035-x86-load-sreg-adjust.patch
  20059-vmx-nmi-handling.patch
  20077-x86-runstate-cswitch-out.patch
  20078-x86_64-branch-emulation.patch
  20101-hvm-no-compat-virt-start.patch
  20112-x86-dom0-boot-run-timers.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=13
2009-08-28 22:25:44 +00:00

40 lines
1.6 KiB
Diff

# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1249470279 -3600
# Node ID e41d42ef4cd2968cd480063a3c82d91c38cb8c7d
# Parent 3242351f9c6766fe4fbc27d969b1b84a9926cbda
xend: fix memory leak resulting in long garbage collector runs
In the method xen.xend.XendStateStore.XendStateStore.load_state and
xen.xend.XendStateStore.XendStateStore.save_state the minidom objects
used to load/save the current state of a device type, can't be freed
by the python garbage collector after all references to the top node
are cleared, because of cyclic references between the DOM nodes. So
memory usage of xend increases after calling these methods. To solve
this problem, the unlink() method must be called for a minidom object
before the last reference to the top node is cleared (see python
docs). This breaks the cyclic references, so the garbage collector can
free these objects.
Signed-off-by: juergen.gross@ts.fujitsu.com
Index: xen-3.4.1-testing/tools/python/xen/xend/XendStateStore.py
===================================================================
--- xen-3.4.1-testing.orig/tools/python/xen/xend/XendStateStore.py
+++ xen-3.4.1-testing/tools/python/xen/xend/XendStateStore.py
@@ -147,6 +147,7 @@ class XendStateStore:
cls_dict[val_name] = bool(int(val_text))
state[uuid] = cls_dict
+ dom.unlink()
return state
def save_state(self, cls, state):
@@ -226,5 +227,5 @@ class XendStateStore:
node.appendChild(val_node)
open(xml_path, 'w').write(doc.toprettyxml())
-
+ doc.unlink()