qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: Gerd Hoffmann <kraxel@redhat.com>,
	"Daniel P. Berrange" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/4] vnc: allow the Buffer to shrink again
Date: Thu, 3 Sep 2015 12:36:50 +0200	[thread overview]
Message-ID: <55E822C2.2070907@kamp.de> (raw)
In-Reply-To: <1441273974.557.19.camel@redhat.com>

Am 03.09.2015 um 11:52 schrieb Gerd Hoffmann:
> On Do, 2015-08-27 at 11:39 +0100, Daniel P. Berrange wrote:
>> On Thu, Aug 27, 2015 at 12:18:52PM +0200, Peter Lieven wrote:
>>> currently the Buffer can only grow. This increases Qemu memory footprint
>>> dramatically since normally the biggest VNC updates are at connection time.
>>> But also after a VNC session has terminated there is one persistent buffer
>>> in queue->buffer which I have seen to increase to over 100MB and it is never
>>> getting smaller again.
>> Do you have any idea what caused the buffer to increase to 100MB in size
>> in the first place ? I would expect a full screen update would cause the
>> biggest buffer usage, and even for a 1920x1140 screen that should not
>> be anywhere near 100MB in size. IOW, i'm wondering if the 100MB usage
>> is symptomatic of a more serious bug somewhere else in the VNC code
>> that you're just masking you reducing buffer size afterwards.
> Cooked up a buffer stats patch (attached).
> Buffer sizes are nowhere near 100MB for me (as expected by Daniel).
> Individual buffers are in the 1 -> 4 MB range (1920x1080), even summed
> up this is more like 10 not 100 MB.
>
> So, big question remains why they are that big for you?

Simple case to create at least a reasonable allocation: -vga vmware and a client that prefers Hextile encoding.

~/git/qemu$ x86_64-softmmu/qemu-system-x86_64 -m 4096 -enable-kvm -cdrom  ~/Downloads/ubuntu-14.04.3-desktop-amd64.iso -k de -usb -device usb-tablet -nodefaults -serial null -parallel null -cpu Westmere,enforce -vga vmware -monitor stdio -vnc :0
QEMU 2.4.50 monitor - type 'help' for more information
(qemu) buffer_reserve: 11/out    :    4 kB
buffer_reserve: 11/in     :    4 kB
buffer_reserve: queue     :    4 kB
buffer_reserve: queue     :    8 kB
buffer_reserve: 11/jobs   :    8 kB
buffer_reserve: 11/out    :   16 kB
buffer_reserve: queue     :   16 kB
buffer_reserve: queue     :   32 kB
buffer_reserve: queue     :   64 kB
buffer_reserve: queue     :  128 kB
buffer_reserve: queue     :  256 kB
buffer_reserve: 11/jobs   :  256 kB
buffer_reserve: 11/out    :  256 kB
buffer_reserve: queue     :  512 kB
buffer_reserve: queue     : 1024 kB
buffer_reserve: queue     : 2048 kB
buffer_reserve: 11/jobs   : 2048 kB
buffer_reserve: 11/out    : 2048 kB
buffer_reserve: queue     : 4096 kB
buffer_reserve: queue     : 8192 kB
buffer_reserve: queue     : 16384 kB
buffer_reserve: 11/jobs   : 16384 kB
buffer_reserve: 11/out    : 16384 kB

Its not 100MB, but 50MB.

Same with Tight encoding:

(qemu) buffer_reserve: 11/out    :    4 kB
buffer_reserve: 11/in     :    4 kB
buffer_reserve: queue     :    4 kB
buffer_reserve: 11/t-tight:    4 kB
buffer_reserve: 11/t-tight:    8 kB
buffer_reserve: 11/t-tight:   16 kB
buffer_reserve: 11/t-tight:   32 kB
buffer_reserve: 11/t-tight:   64 kB
buffer_reserve: 11/t-tight:  128 kB
buffer_reserve: 11/t-tight:  256 kB
buffer_reserve: 11/t-tight:  512 kB
buffer_reserve: 11/t-zlib :    4 kB
buffer_reserve: 11/jobs   :    4 kB
buffer_reserve: 11/t-zlib :   64 kB
buffer_reserve: 11/t-tight: 1024 kB
buffer_reserve: 11/t-tight: 2048 kB
buffer_reserve: 11/t-tight: 4096 kB
buffer_reserve: 11/t-tight: 8192 kB
buffer_reserve: 11/t-tight: 16384 kB
buffer_reserve: 11/t-zlib :  128 kB
buffer_reserve: queue     :    8 kB
buffer_reserve: 11/jobs   :    8 kB
buffer_reserve: 11/out    :    8 kB
buffer_reserve: 11/t-zlib :  256 kB
buffer_reserve: queue     :   64 kB
buffer_reserve: queue     :  128 kB
buffer_reserve: queue     :  256 kB
buffer_reserve: queue     :  512 kB
buffer_reserve: queue     : 1024 kB
buffer_reserve: queue     : 2048 kB
buffer_reserve: queue     : 4096 kB
buffer_reserve: queue     : 8192 kB
buffer_reserve: 11/jobs   : 8192 kB
buffer_reserve: 11/out    : 8192 kB

~40MB.

Peter

  parent reply	other threads:[~2015-09-03 10:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 10:18 [Qemu-devel] [PATCH 0/4] VNC server memory savings Peter Lieven
2015-08-27 10:18 ` [Qemu-devel] [PATCH 1/4] vnc: make the Buffer capacity increase in powers of two Peter Lieven
2015-09-03  8:56   ` Gerd Hoffmann
2015-09-03 10:29     ` Peter Lieven
2015-09-03 10:47       ` Gerd Hoffmann
2015-08-27 10:18 ` [Qemu-devel] [PATCH 2/4] vnc: allow the Buffer to shrink again Peter Lieven
2015-08-27 10:39   ` Daniel P. Berrange
2015-08-27 12:36     ` Peter Lieven
2015-09-03  9:52     ` Gerd Hoffmann
2015-09-03 10:07       ` Peter Lieven
2015-09-03 11:52         ` Gerd Hoffmann
2015-09-03 14:52           ` Peter Lieven
2015-09-03 10:36       ` Peter Lieven [this message]
2015-09-03 11:57         ` Gerd Hoffmann
2015-09-03 12:00           ` Peter Lieven
2015-08-27 10:18 ` [Qemu-devel] [PATCH 3/4] vnc-jobs: move buffer_reset to vnc_async_encoding_end Peter Lieven
2015-08-27 10:18 ` [Qemu-devel] [PATCH 4/4] vnc: destroy server surface if no client is connected Peter Lieven
2015-09-03  9:57   ` Gerd Hoffmann
2015-09-03 10:08     ` Peter Lieven
2015-09-03 10:54       ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55E822C2.2070907@kamp.de \
    --to=pl@kamp.de \
    --cc=berrange@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).