* [Qemu-devel] [FYI] memory leak in 0.14.0rc1 ?
@ 2011-02-15 11:10 Torsten Förtsch
2011-02-15 14:43 ` Stefan Hajnoczi
0 siblings, 1 reply; 6+ messages in thread
From: Torsten Förtsch @ 2011-02-15 11:10 UTC (permalink / raw)
To: qemu-devel
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:
http://download.opensuse.org/repositories/Virtualization/openSUSE_11.3/x86_64/kvm-0.14.0.rc1-67.1.x86_64.rpm
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [FYI] memory leak in 0.14.0rc1 ?
2011-02-15 11:10 [Qemu-devel] [FYI] memory leak in 0.14.0rc1 ? Torsten Förtsch
@ 2011-02-15 14:43 ` Stefan Hajnoczi
2011-02-15 17:20 ` Torsten Förtsch
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Hajnoczi @ 2011-02-15 14:43 UTC (permalink / raw)
To: Torsten Förtsch; +Cc: qemu-devel
2011/2/15 Torsten Förtsch <torsten.foertsch@gmx.net>:
> I am trying out the opensuse kvm rpm from the Virtualization repository:
>
> http://download.opensuse.org/repositories/Virtualization/openSUSE_11.3/x86_64/kvm-0.14.0.rc1-67.1.x86_64.rpm
>
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [FYI] memory leak in 0.14.0rc1 ?
2011-02-15 14:43 ` Stefan Hajnoczi
@ 2011-02-15 17:20 ` Torsten Förtsch
2011-02-15 20:16 ` Stefan Hajnoczi
0 siblings, 1 reply; 6+ messages in thread
From: Torsten Förtsch @ 2011-02-15 17:20 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Hajnoczi
On Tuesday, February 15, 2011 15:43:32 Stefan Hajnoczi wrote:
> > 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?
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [FYI] memory leak in 0.14.0rc1 ?
2011-02-15 17:20 ` Torsten Förtsch
@ 2011-02-15 20:16 ` Stefan Hajnoczi
2011-02-25 18:21 ` Torsten Förtsch
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Hajnoczi @ 2011-02-15 20:16 UTC (permalink / raw)
To: Torsten Förtsch; +Cc: qemu-devel, Alexander Graf
2011/2/15 Torsten Förtsch <torsten.foertsch@gmx.net>:
> On Tuesday, February 15, 2011 15:43:32 Stefan Hajnoczi wrote:
>> > 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.
Thank you for checking this. This is probably a Suse-specific or
qemu-kvm issue.
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [FYI] memory leak in 0.14.0rc1 ?
2011-02-15 20:16 ` Stefan Hajnoczi
@ 2011-02-25 18:21 ` Torsten Förtsch
2011-02-25 19:00 ` Bruce Rogers
0 siblings, 1 reply; 6+ messages in thread
From: Torsten Förtsch @ 2011-02-25 18:21 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-devel, Alexander Graf
On Tuesday, February 15, 2011 21:16:49 Stefan Hajnoczi wrote:
> 2011/2/15 Torsten Förtsch <torsten.foertsch@gmx.net>:
> > On Tuesday, February 15, 2011 15:43:32 Stefan Hajnoczi wrote:
> >> > 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.
>
> 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-thread
grow.
Torsten Förtsch
--
Need professional modperl support? Hire me! (http://foertsch.name)
Like fantasy? http://kabatinte.net
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] [FYI] memory leak in 0.14.0rc1 ?
2011-02-25 18:21 ` Torsten Förtsch
@ 2011-02-25 19:00 ` Bruce Rogers
0 siblings, 0 replies; 6+ messages in thread
From: Bruce Rogers @ 2011-02-25 19:00 UTC (permalink / raw)
To: Stefan Hajnoczi, Torsten Förtsch
Cc: qemu-devel, corentin.chary, Alexander Graf
>>> On 2/25/2011 at 11:21 AM, Torsten Förtsch<torsten.foertsch@gmx.net> wrote:
> On Tuesday, February 15, 2011 21:16:49 Stefan Hajnoczi wrote:
>> 2011/2/15 Torsten Förtsch <torsten.foertsch@gmx.net>:
>> > On Tuesday, February 15, 2011 15:43:32 Stefan Hajnoczi wrote:
>> >> > 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.
>>
>> 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-thread
>
> grow.
>
> 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:
diff --git a/ui/vnc-jobs-async.c b/ui/vnc-jobs-async.c
index 0b5d750..ebdba41 100644
--- a/ui/vnc-jobs-async.c
+++ b/ui/vnc-jobs-async.c
@@ -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
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-02-25 19:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 11:10 [Qemu-devel] [FYI] memory leak in 0.14.0rc1 ? Torsten Förtsch
2011-02-15 14:43 ` Stefan Hajnoczi
2011-02-15 17:20 ` Torsten Förtsch
2011-02-15 20:16 ` Stefan Hajnoczi
2011-02-25 18:21 ` Torsten Förtsch
2011-02-25 19:00 ` Bruce Rogers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).