public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Guest memory usage
@ 2008-02-05 13:23 Dietmar Maurer
       [not found] ` <E88155B5BD67CE4D87A3F1F70950B96A1AFF63-Mtm3uwm0nrWenyD9vqZGNUEOCMrvLtNR@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Dietmar Maurer @ 2008-02-05 13:23 UTC (permalink / raw)
  To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Is there a monitor command to query the guest memory usage?

Using Host VSZ/RSS gives wrong values - looks like allocated pages get
never free?

- Dietmar


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Guest memory usage
       [not found] ` <E88155B5BD67CE4D87A3F1F70950B96A1AFF63-Mtm3uwm0nrWenyD9vqZGNUEOCMrvLtNR@public.gmane.org>
@ 2008-02-05 16:36   ` Anthony Liguori
       [not found]     ` <47A8907B.7040206-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2008-02-05 16:36 UTC (permalink / raw)
  To: Dietmar Maurer; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Dietmar Maurer wrote:
> Is there a monitor command to query the guest memory usage?
>
> Using Host VSZ/RSS gives wrong values - looks like allocated pages get
> never free?
>   

The VSZ/RSS is correct.  What you're seeing is probably a mix of two 
things.  In the absence of MMU notifiers, not all memory is reclaimable 
all the time.  Second, reducing the RSS size and free()'ing in the guest 
are not related operations.

Regards,

Anthony Liguori

> - Dietmar
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Guest memory usage
       [not found]     ` <47A8907B.7040206-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2008-02-06  5:10       ` Dietmar Maurer
       [not found]         ` <E88155B5BD67CE4D87A3F1F70950B96A1AFF69-Mtm3uwm0nrWenyD9vqZGNUEOCMrvLtNR@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Dietmar Maurer @ 2008-02-06  5:10 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Hi Anthony,

The problem is that memory always grows, even after rebooting the VM.
 
> The VSZ/RSS is correct.  What you're seeing is probably a mix 
> of two things.  In the absence of MMU notifiers, not all 

Sorry for asking stupid questions: Why are they absent? Isn't there a
way
to track memory usage? There are 'info tlb' and 'info mem' commands - 
isn't it possible to construct better memory usage statistics whith that
info?

- Dietmar 


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Guest memory usage
       [not found]         ` <E88155B5BD67CE4D87A3F1F70950B96A1AFF69-Mtm3uwm0nrWenyD9vqZGNUEOCMrvLtNR@public.gmane.org>
@ 2008-02-06 19:44           ` Anthony Liguori
  0 siblings, 0 replies; 4+ messages in thread
From: Anthony Liguori @ 2008-02-06 19:44 UTC (permalink / raw)
  To: Dietmar Maurer; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Dietmar Maurer wrote:
> Hi Anthony,
>
> The problem is that memory always grows, even after rebooting the VM.
>   

When you start a VM, none of the memory for that VM has been reserved by 
Linux regardless of what you specify in the '-m' parameter.  Instead, as 
the guest starts to access memory, Linux begins to allocate memory for 
the guest.

free()'ing memory in the guest, rebooting the system, or anything else 
that you might thing should reduce memory consumption within the guest 
is meaningless to KVM.  One a KVM guest has accessed memory, that memory 
is permanently allocated.

There is, of course, an exception.  If the host system is low on memory, 
then Linux will request that KVM remove memory from the guest.  Again, 
this has nothing to do with what's going on in the guest, instead it has 
to do with what's going on in the host.

The Linux host is acting to balance out memory in the most appropriate 
way to maximize performance.  The guest will get as much memory as it 
needs until the host system starts getting low on memory.

If you want to know what much of the memory the guest is using, you need 
to ask the guest to tell you that.

Regards,

Anthony Liguori

>> The VSZ/RSS is correct.  What you're seeing is probably a mix 
>> of two things.  In the absence of MMU notifiers, not all 
>>     
>
> Sorry for asking stupid questions: Why are they absent? Isn't there a
> way
> to track memory usage? There are 'info tlb' and 'info mem' commands - 
> isn't it possible to construct better memory usage statistics whith that
> info?
>
> - Dietmar 
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-02-06 19:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-05 13:23 Guest memory usage Dietmar Maurer
     [not found] ` <E88155B5BD67CE4D87A3F1F70950B96A1AFF63-Mtm3uwm0nrWenyD9vqZGNUEOCMrvLtNR@public.gmane.org>
2008-02-05 16:36   ` Anthony Liguori
     [not found]     ` <47A8907B.7040206-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-02-06  5:10       ` Dietmar Maurer
     [not found]         ` <E88155B5BD67CE4D87A3F1F70950B96A1AFF69-Mtm3uwm0nrWenyD9vqZGNUEOCMrvLtNR@public.gmane.org>
2008-02-06 19:44           ` Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox