This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


[Xen-bugs] [Bug 1507] New: memory leak in pyxc_physinfo in xc.c

To: xen-bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-bugs] [Bug 1507] New: memory leak in pyxc_physinfo in xc.c
From: bugzilla-daemon@xxxxxxxxxxxxxxxxxxx
Date: Wed, 9 Sep 2009 08:49:47 -0700
Delivery-date: Wed, 09 Sep 2009 08:49:52 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-bugs-request@lists.xensource.com?subject=help>
List-id: Xen Bugzilla <xen-bugs.lists.xensource.com>
List-post: <mailto:xen-bugs@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-bugs>, <mailto:xen-bugs-request@lists.xensource.com?subject=unsubscribe>
Reply-to: bugs@xxxxxxxxxxxxxxxxxx
Sender: xen-bugs-bounces@xxxxxxxxxxxxxxxxxxx

           Summary: memory leak in pyxc_physinfo in xc.c
           Product: Xen
           Version: unstable
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Tools
        AssignedTo: xen-bugs@xxxxxxxxxxxxxxxxxxx
        ReportedBy: kingram@xxxxxxxxx

When physinfo() is called it returns a dictionary containing information about
the host server. 

Two new items have been added to the dictionary since Xen 3.0.3, "node_to_cpu"
and "node_to_memory". I think there is something wrong with the way these are
created - something to do with the reference counting, I'm not sure what - but
every call to physinfo leaves a copy of these two objects on the heap that
don't get garbage collected.

So if I use gc.get_objects() before and after calls to physinfo I can see these
two objects per call and they don't go away when the dictionary returned by the
function is gone and the garbage collector has been called.

We have seen this problem because we are using libvirt to monitor our system.
We get the domains through libvirt, every few seconds.  This causes physinfo to
be called (from XendNode.py), so we see the xend memory constantly increasing.

Using gc.get_objects I was able to track the problem down to physinfo and that
the leaked objects were the "node_to_cpu" and "node_to_memory" lists.

To reproduce the problem, run "xm info" continuously (it calls physinfo). With
one VM, xend memory increases at about 1 meg every 3 or 4 minutes. The leak
size is proportional to the number of VMs because the objects being leaked are
per VM.

Configure bugmail: 
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Xen-bugs mailing list

<Prev in Thread] Current Thread [Next in Thread>