[TriLUG] kvm memory usage seems high

John Mitchell via TriLUG trilug at trilug.org
Sat Oct 22 08:58:51 EDT 2016


You might do a quick test:

   Appears that qemu is using about 216 meg ( 472 - 256 = 216).
try qemu -m512 (for example) and see if usage is close to 728 Meg.
512 + 216 = 728.

john mitchell

On Fri, Oct 21, 2016 at 9:41 PM, Kevin Hunter Kesling via TriLUG <
trilug at trilug.org> wrote:

> Hello TriLUG,
>
> I recently started playing around with KVM, and have found myself with a
> few longer-running VMs.  Like many, I suspect, I was hoping to take
> advantage of KSM, and at first, things seemed to be in order.  However, I'm
> now noting that some instances seem to use a lot more memory than I've told
> them to use (qemu ... -m ...), and I'm hoping TriLUG can offer some
> insights.
>
> First, my two-sentence understanding of Qemu/KVM is that guests are just
> normal Linux processes.  When the virtual machine starts up, Qemu allocates
> X amount of RAM, and the host -- with the usual overcommit heuristics --
> says "Ok!" to the process.
>
> Mosts guests I provision need no more than 256 MB.  I'm somewhat
> surprised, then, when I see that they have way more than that in RSS (as
> measured via htop on the host).  I'd expect some overhead for Qemu, but
> almost twice that?  For example, here's what 'ps' reports for one such
> process (of a few)
>
>     $ ps waux | kevins_manual_awk_grep_whatev
>
>     USER  ...     VSZ    RSS ... COMMAND
>     kevin ... 3316012 472268 ... qemu-system-x86_64 ... -m 256
>
> So, for a 256 MB allocation, the process is using 483 MB (461 MiB) on the
> host?  (The guest registers 236 MiB via free.)  That seems ... off. Does
> Qemu really incur *that* much overhead?
>
> If it matters (and as I write this I realize I have not tried turning it
> off), ksmtuned is indeed installed:
>
>     $ cat pages_shared pages_sharing
>     103674
>     380764
>
> and on both hosts showing this behavior, the kernel is 4.4.
>
> My google-fu to explain this behavior has not been so great, so I am
> hoping TriLUG might have some insight or experience to help explain this
> extra memory use.
>
> Thanks!
>
> Kevin
> --
> This message was sent to: john mitchell <john280z at gmail.com>
> To unsubscribe, send a blank message to trilug-leave at trilug.org from that
> address.
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> Unsubscribe or edit options on the web  : http://www.trilug.org/mailman/
> options/trilug/john280z%40gmail.com
> Welcome to TriLUG: http://trilug.org/welcome


More information about the TriLUG mailing list