KVM - The Linux Kernel-Based Virtual Machine
News, Blogs and Resources on the Linux (KVM) Kernel-Based Virtual Machine

qemu-kvm and unused RES memory

1 reply [Last post]
sa10
Offline
Joined: Sep 22 2011
Points: 3

Hello,
I think it is abnormal when the process of qemu-kvm does not release unused resident memory .
For example, at start the virtual server qemu-kvm uses memory as: VIRT = 2322m, RES = 660m
I fill his memory running the script inside virtual server, but when memory is freed inside the container,  RES= 2.0g and never had not diminished.

So it must be, or this can be changed?

kernel: 2.6.32-71.29.1.el6.x86_64
libvirt-0.8.1-27.el6_0.6.x86_64
qemu-kvm-0.12.1.2-2.113.el6_0.8.x86_64
qemu-kvm-tools-0.12.1.2-2.113.el6_0.8.x86_64

script for filling memory 

#!/usr/bin/perl
use strict;
$|=1;
my @a;
my $allocated=0;
my $blocksize=10;
foreach my $i(1..1024){
  my $time = time();
  my $s = '1' x ($blocksize*1024*1024);
  push @a, $s;
  $allocated += $blocksize;
  print "\r$allocated Mb";
  $s = $a[$i-10]; # read data - from swap slow!
  if( time()-$time > 10 ){
    print "\n$allocated Mb: Slow memory allocation\n";
    last;
  }

Jonathan (not verified)
I think is abnormal too when

I think is abnormal too when the process of qemu-kvm does not release unused resident memory, but can we do about it? In my opinion this cannot be changed but I hope I'm mistaken.
Cazare ieftina Brasov

Post new comment

The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.