memory leak in 0.14.0rc1 ?
Hi,
perhaps this is the wrong list. If so then please accept my apology.
I am trying out the opensuse kvm rpm from the Virtualization repository:
I have installed winxp and run the machine as "/usr/bin/qemu-kvm -name xp.home -m 768 ...".
On the machine I have compiled perl from the sources.
After a fresh start, when I try to run the perl test suite the process size grows to ~2500 Mb with an RSS of 2.2 Gb. On a second run of the test suite the process size and RSS continue to grow.
I'd expect the memory consumption to be limited somewhere between 768 Mb and 1 Gb.
See also https://bugzilla.novell.com/show_bug.cgi?id=671809
Torsten Förtsch
2011/2/15 Torsten Förtsch <[email protected]>:
Quoted 6 lines
I am trying out the opensuse kvm rpm from the Virtualization repository:
I have installed winxp and run the machine as "
/usr/bin/qemu-kvm-name xp.home -m 768 ...".
Are you able to try QEMU 0.14.0-rc2 from source?
$ git clone git://git.qemu.org/qemu.git $ git checkout v0.14.0-rc2 $ ./configure --target-list=x86_64-softmmu --enable-io-thread --disable-strip --prefix=/usr $ make $ x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 768 -name xp.home ...
Also, please post your full KVM command-line so we know what devices and features you have enabled.
Stefan
Quoted 11 lines · On Tuesday, February 15, 2011 15:43:32 Stefan Hajnoczi wrote:
Quoted 2 lines
I have installed winxp and run the machine as "
/usr/bin/qemu-kvm-name xp.home -m 768 ...".Are you able to try QEMU 0.14.0-rc2 from source?
$ git clone git://git.qemu.org/qemu.git $ git checkout v0.14.0-rc2 $ ./configure --target-list=x86_64-softmmu --enable-io-thread --disable-strip --prefix=/usr $ make $ x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 768 -name xp.home ...
Now, the process size stays around 1300 Mb and RSS is very constant at 794 Mb.
But the VM is much slower. Although, according to "info kvm" kvm is enabled.
What options do I have to use to get optimal performance?
Quoted 2 lines
Also, please post your full KVM command-line so we know what devices and features you have enabled.
x86_64-softmmu/qemu-system-x86_64 \
-name xp.home -boot order=dc \
-drive file=/.../xp.home/root.raw,if=virtio \
-drive file=/.../config.cpio,if=floppy,index=1 \
-m 768 \
-usb \
-rtc base=utc,clock=host \
-vga std \
-cpu host \
-smp 2 \
-enable-kvm \
-balloon virtio \
-vnc 127.0.0.1:15 \
-monitor unix:/.../xp.home/.monitor,server,nowait \
-serial unix:/.../xp.home/.ttyS0,server,nowait \
-net nic,vlan=0,model=virtio,macaddr=E0:23:DA:00:00:05 \
-net tap,vlan=0,name=ext,ifname=qe5,script=/.../qemu-ifup,downscript=/.../qemu-ifdown \
-net nic,vlan=1,model=virtio,macaddr=F0:23:DA:00:00:05 \
-net tap,vlan=1,name=int,ifname=qi5,script=/.../qemu-ifup,downscript=/.../qemu-ifdown \
-rtc base=localtime \
-usbdevice tablet
In the original command there was another option "boot=on" on the 1st drive. And, the -daemonize option was given.
BTW, the monitor still says it's QEMU 0.13.92, not 0.14.
Torsten Förtsch
2011/2/15 Torsten Förtsch <[email protected]>:
Quoted 6 lines · On Tuesday, February 15, 2011 15:43:32 Stefan Hajnoczi wrote:
Quoted 5 lines
Quoted 2 lines
I have installed winxp and run the machine as "
/usr/bin/qemu-kvm-name xp.home -m 768 ...".Are you able to try QEMU 0.14.0-rc2 from source?
Quoted 8 lines
Quoted 6 lines
$ git clone git://git.qemu.org/qemu.git $ git checkout v0.14.0-rc2 $ ./configure --target-list=x86_64-softmmu --enable-io-thread --disable-strip --prefix=/usr $ make $ x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 768 -name xp.home ...Now, the process size stays around 1300 Mb and RSS is very constant at 794 Mb.
Thank you for checking this. This is probably a Suse-specific or qemu-kvm issue.
Quoted 3 lines
But the VM is much slower. Although, according to "info kvm" kvm is enabled.
What options do I have to use to get optimal performance?
Is it general sluggishness or do you notice something specific like disk or networking? I usually set -drive cache=none which tries to bypass the host page cache and does not sync to disk after every write operation.
Stefan
Quoted 14 lines · On Tuesday, February 15, 2011 21:16:49 Stefan Hajnoczi wrote:
2011/2/15 Torsten Förtsch <[email protected]>:
Quoted 13 lines · On Tuesday, February 15, 2011 15:43:32 Stefan Hajnoczi wrote:
Quoted 11 lines
Quoted 2 lines
I have installed winxp and run the machine as "
/usr/bin/qemu-kvm-name xp.home -m 768 ...".Are you able to try QEMU 0.14.0-rc2 from source?
$ git clone git://git.qemu.org/qemu.git $ git checkout v0.14.0-rc2 $ ./configure --target-list=x86_64-softmmu --enable-io-thread --disable-strip --prefix=/usr $ make $ x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 768 -name xp.home ...
Quoted 5 lines
Quoted 2 lines
Now, the process size stays around 1300 Mb and RSS is very constant at 794 Mb.
Thank you for checking this. This is probably a Suse-specific or qemu-kvm issue.
Just for your information, it turns out that --enable-vnc-thread is the culprit, see
https://bugzilla.novell.com/show_bug.cgi?id=671809
The method explained there (comment 4) also makes a 0.14.0 compiled from the sources and configured as
./configure --target-list=x86_64-softmmu \
--enable-io-thread --enable-vnc-threadgrow.
Torsten Förtsch
Signature · 3 lines
Need professional modperl support? Hire me! (http://foertsch.name) Like fantasy? http://kabatinte.net
Quoted 29 lines
Quoted 1 line
Quoted 1 line · Torsten Förtsch
Quoted 14 lines · On Tuesday, February 15, 2011 21:16:49 Stefan Hajnoczi wrote:
2011/2/15 Torsten Förtsch <[email protected]>:
Quoted 13 lines · On Tuesday, February 15, 2011 15:43:32 Stefan Hajnoczi wrote:
Quoted 11 lines
Quoted 2 lines
I have installed winxp and run the machine as "
/usr/bin/qemu-kvm-name xp.home -m 768 ...".Are you able to try QEMU 0.14.0-rc2 from source?
$ git clone git://git.qemu.org/qemu.git $ git checkout v0.14.0-rc2 $ ./configure --target-list=x86_64-softmmu --enable-io-thread --disable-strip --prefix=/usr $ make $ x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 768 -name xp.home ...Quoted 5 lines
Quoted 2 lines
Now, the process size stays around 1300 Mb and RSS is very constant at 794 Mb.
Thank you for checking this. This is probably a Suse-specific or qemu-kvm issue.
Just for your information, it turns out that --enable-vnc-thread is the culprit, see
https://bugzilla.novell.com/show_bug.cgi?id=671809
The method explained there (comment 4) also makes a 0.14.0 compiled from the
Quoted 8 lines
sources and configured as
./configure --target-list=x86_64-softmmu \ --enable-io-thread --enable-vnc-threadgrow.
Torsten Förtsch
I haven't played much in the vnc code, but the following patch at least gets rid of the leak. I'm not sure if it's the "correct" solution. If someone more familiar with the vnc code wants to look into this, that would be great:
ui/vnc-jobs-async.c +0 -1
@@ -52,7 +52,6 @@ struct VncJobQueue {QemuCond cond;QemuMutex mutex;QemuThread thread; -Buffer buffer;bool exit; QTAILQ_HEAD(, VncJob) jobs; };
@@ -171,10 +170,9 @@ static void vnc_async_encoding_start(VncState *orig, VncSta
te *local)
local->tight = orig->tight;
local->zlib = orig->zlib;
local->hextile = orig->hextile;
- local->output = queue->buffer;
local->csock = -1; /* Don't do any network work on this thread */- buffer_reset(&local->output);
+ buffer_free(&local->output);
}
static void vnc_async_encoding_end(VncState *orig, VncState *local)
@@ -288,7 +286,6 @@ static void vnc_queue_clear(VncJobQueue *q)
{
qemu_cond_destroy(&queue->cond);
qemu_mutex_destroy(&queue->mutex);- buffer_free(&queue->buffer);
qemu_free(q);
queue = NULL; /* Unset global queue */
}
Bruce