Bug 438603 - KVM does not free allocated memory
Summary: KVM does not free allocated memory
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kvm
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-22 18:08 UTC by Ralf Ertzinger
Modified: 2008-03-31 15:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-03-31 15:21:44 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Ralf Ertzinger 2008-03-22 18:08:12 UTC
Description of problem:
Stopping a kvm-enabled virtual machine does not free the memory allocated to
that machine, the memory is essentially lost until the kernel is rebooted.

Looks like this:
[sun@lain ~/xen/xos :) 38]$ free
             total       used       free     shared    buffers     cached
Mem:       3084812    2362980     721832          0      54752    1417440
-/+ buffers/cache:     890788    2194024
Swap:      1015800          0    1015800
[sun@lain ~/xen/xos :) 40]$ sudo ./start
(this essentially starts qemu-kvm with the necessary parameters, this machine
has 256MB RAM allocated)
config qemu network with bridge for  tap1
^C
[sun@lain ~/xen/xos :( (1) 41]$ free
             total       used       free     shared    buffers     cached
Mem:       3084812    2615736     469076          0      55368    1416820
-/+ buffers/cache:    1143548    1941264
Swap:      1015800          0    1015800

As can be seen, the "used" memory has increased by roughly 256MB.

Version-Release number of selected component (if applicable):
kvm-63-2.fc9.i386
kernel-PAE-2.6.25-0.136.rc6.git5.fc9.i686


How reproducible:
Always

Steps to Reproduce:
1. see above
2.
3.
  
Actual results:
Memory for the virtual machine is never freed

Expected results:
Memory for the virtual machine is freed after machine shutdown

Additional info:

Comment 1 Daniel Berrangé 2008-03-23 13:52:03 UTC
Bug in 2.6.25-fc5 kernel, patch on kvm-devel

http://article.gmane.org/gmane.comp.emulators.kvm.devel/14867

Comment 2 Jeremy Katz 2008-03-24 01:07:21 UTC
As Dan says, this is being discussed on kvm-devel.  Although apparently that
patch isn't quite enough to fix it.  Once there's a fix in the thread, I'll make
sure it gets into our kernels.

Comment 3 Jeremy Katz 2008-03-31 15:21:44 UTC
Should be fixed with current kernels (we added the patch, then took in the
upstream version)


Note You need to log in before you can comment on or make changes to this bug.