Received: from eggs.gnu.org ([2001:4830:134:3::10]:59789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLaxR-0007nw-0a for qemu-devel@nongnu.org; Thu, 06 Mar 2014 11:15:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLaxJ-0006Q7-DZ for qemu-devel@nongnu.org; Thu, 06 Mar 2014 11:15:40 -0500 Received: from indium.canonical.com ([91.189.90.7]:36358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLaxJ-0006Pv-7l for qemu-devel@nongnu.org; Thu, 06 Mar 2014 11:15:33 -0500 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1WLaxI-0002Ay-Ih for ; Thu, 06 Mar 2014 16:15:32 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 6F0262E80BA for ; Thu, 6 Mar 2014 16:15:32 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 06 Mar 2014 16:06:00 -0000 From: Stefan Weil <1288620@bugs.launchpad.net> Sender: bounces@canonical.com References: <20140306085506.13520.47301.malonedeb@gac.canonical.com> Message-Id: <20140306160600.13704.71416.malone@gac.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1288620] Re: memory leak with default NIC model Reply-To: Bug 1288620 <1288620@bugs.launchpad.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Please try to reproduce this with a debug built (configure --enable- debug) from latest QEMU. If it shows the same memory leak, you can try to find the cause of this leak with valgrind: valgrind --leak-check=3Dfull qemu-system-x86_64 -drive file=3Dwindows_base_HDD.img,index=3D0,media=3Ddisk -enable-kvm -m 512M -vga std -net nic,vlan=3D0 -net user,vlan=3D0 2>&1 | tee valgrind.log As soon as you terminate the running qemu process, valgrind will write a pr= otocol of all allocated memory. Leaks can usually be found quite easily in = this protocol: after a long run, the leak will dominate any other memory al= location. If your executable still contains the full debug information, you= will also see the exact line of source code which allocates repeatedly mem= ory. = Please note that valgrind slows down your process by a factor of 10 to 20, = so it takes some time to run Windows. If valgrind does not work (which sometimes happens), you can attach a debugger (gdb) to the running qemu process and try to detect the buggy memory allocation by setting breakpoints on the memory allocator functions (malloc or g_malloc, g_malloc0, g_new, g_new0). -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1288620 Title: memory leak with default NIC model Status in QEMU: New Bug description: I have a Windows 7 SP1 Professional 64-bit installation on a QCOW2 image with compat=3D1.1, which I launch via qemu-system-x86_64 -drive file=3Dwindows_base_HDD.img,index=3D0,media=3Dd= isk -enable-kvm -m 512M -vga std -net nic,vlan=3D0 -net user,vlan=3D0 As soon as I start using the network in any application =E2=80=94 for exa= mple, visiting www.google.com in Internet Explorer =E2=80=94 QEMU starts gobbli= ng memory until the (host) kernel kills it because of an OOM condition. If I run the QEMU with the same options, but with model=3De1000 option set for the NIC (i.e. -net -nic,vlan=3D0,model=3De1000), I can use the network from the guest OS without any noticeable effect on QEMU's memory consumption. I do not have this problem when running QEMU with the exact same options = (as above, without model=3De1000) but with a Debian wheezy installation (on= a QCOW image of the same format). My host system in Ubuntu 13.10 x86_64, = kernel image 3.11.0-17-generic, but with the QEMU packages from trusty (the= codename for the next release): Output of `dpkg -l \*qemu\* | grep '^ii'`: ii ipxe-qemu 1.0.0+git-20130710.936134e-0ubu= ntu1 all Virtual package to support use of kvm-ipxe with qe= mu ii qemu-keymaps 1.7.0+dfsg-3ubuntu2 = all QEMU keyboard maps ii qemu-system-common 1.7.0+dfsg-3ubuntu2 = amd64 QEMU full system emulation binaries (common files) ii qemu-system-x86 1.7.0+dfsg-3ubuntu2 = amd64 QEMU full system emulation binaries (x86) ii qemu-utils 1.7.0+dfsg-3ubuntu2 = amd64 QEMU utilities (If necessary, I can try to reproduce this with QEMU built from the upstream source or the latest source from version control.) To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1288620/+subscriptions