From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leszek Urbanski Subject: Huge memory leak in virtio, see kvm-Bugs-2989366 Date: Wed, 21 Apr 2010 00:29:56 +0200 Message-ID: <20100420222956.GA13218@moo.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 To: kvm@vger.kernel.org Return-path: Received: from moo.pl ([217.149.240.132]:65033 "EHLO moo.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753186Ab0DTWgm (ORCPT ); Tue, 20 Apr 2010 18:36:42 -0400 Received: from localhost (localhost [127.0.0.1]) by moo.pl (Postfix) with ESMTP id 77DBD183EF for ; Wed, 21 Apr 2010 00:30:00 +0200 (CEST) Received: from moo.pl ([127.0.0.1]) by localhost (moo.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FUtn8k3V4Oqa for ; Wed, 21 Apr 2010 00:29:57 +0200 (CEST) Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Hi, this is a follow-up to bug 2989366: https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2989366&group_id=180599 after extensive debugging with the guys on #kvm it turns out that the leak is in the qemu-kvm userland process, in virtio-blk. A summary of my setup is described in the bug report above. The affected guests have a common load profile: frequent sequential I/O on large (~ 2 GB) files. I tried switching off or changing almost all options in my qemu command line and the only option that makes a difference is -drive if=virtio. When an affected guest is run with virtio drives the qemu-kvm process starts leaking immediately after startup and grows (for the most heavily leaking guests) by ~ 1 GB RSS for every ten hours (and keeps growing until OOM). With -drive if=ide or scsi, it doesn't leak at all. A diff of /proc//maps of an affected qemu-kvm at startup and after 1.5 hrs: -039b9000-5ccd0000 rw-p 00000000 00:00 0 +039b9000-65803000 rw-p 00000000 00:00 0 (a heap leak?) I'm willing to debug further. The problem is 100% reproducible. -- Leszek "Tygrys" Urbanski, SCSA, SCNA "Unix-to-Unix Copy Program;" said PDP-1. "You will never find a more wretched hive of bugs and flamers. We must be cautious." -- DECWARS http://cygnus.moo.pl/ -- Cygnus High Altitude Balloon