RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 789417 - Fix memory leak in register save load due to xsave support
Summary: Fix memory leak in register save load due to xsave support
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm
Version: 6.2
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Alex Williamson
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 757768 (view as bug list)
Depends On:
Blocks: 805550
TreeView+ depends on / blocked
 
Reported: 2012-02-10 18:17 UTC by Alex Williamson
Modified: 2012-06-20 11:39 UTC (History)
14 users (show)

Fixed In Version: qemu-kvm-0.12.1.2-2.228.el6
Doc Type: Bug Fix
Doc Text:
Cause: Missing free in managing xSave processor state. Consequence: qemu-kvm leaks memory when guest makes use of processor xSave functionality. Fix: Free buffers used for managing xSave support. Result: qemu-kvm no longer leaks memory.
Clone Of:
Environment:
Last Closed: 2012-06-20 11:39:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0746 0 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2012-06-19 19:31:48 UTC

Description Alex Williamson 2012-02-10 18:17:21 UTC
Description of problem:
xsave support leaks memory at a very high rate.  This can be seen using a Linux guest with -vga std and interacting with a graphical desktop.

Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.198.el6

How reproducible:
100%

Steps to Reproduce:
1. Start a Linux guest with graphical desktop
2. Watch top
3.
  
Actual results:
VM resident memory grows and grows

Expected results:
No memory leaks, grows to fixed amount and stops

Additional info:
Problem identified by Jeff Cody

Bisected and upstream patch identified

Comment 4 David Jaša 2012-03-13 14:34:01 UTC
*** Bug 757768 has been marked as a duplicate of this bug. ***

Comment 5 David Jaša 2012-03-13 14:35:51 UTC
Adding a TestBlocker keyword from duplicate bug.

Comment 7 FuXiangChun 2012-03-15 15:27:19 UTC
I am trying to verify it, I will update soon result to this when verifying it.

Comment 8 FuXiangChun 2012-03-19 06:43:48 UTC
1.reproduce bug with qemu-kvm-0.12.1.2-2.209.el6.x86_64

Steps to Reproduce:
1.1. install fedora 16 in a VM on sandy bridge host
    /usr/libexec/qemu-kvm -M rhel6.2.0 -m 2G -smp 4 -netdev tap,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:94:a3:8b -uuid 7c73a852-c316-4d61-b913-9dde17367a30  -drive file=fedora16.qcow2,if=none,id=drive-virtio-disk0,format=qcow2 -device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-blk-pci0 -boot n -monitor stdio -spice disable-ticketing,port=5913 -vga qxl

1.2. log into gnome shell
1.3. watch VM usage of host memory
1.4. launch four windows and move it back and forth

testing result:
(1)VM resident(7.2G) memory grows and grows 
Mem:   7879396k total,  7773728k used,   105668k free,      284k buffers
Swap:  1048568k total,    34208k used,  1014360k free,    83444k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                    
22174 root      20   0 9251m 7.2g 4336 S 19.3 96.3   2:52.82 qemu-kvm 

(2) memory leak lead to qemu exit 

2.verify bug with qemu-kvm-0.12.1.2-2.236.el6.x86_64
  
  Use the same steps with above

testing result:
(1) resident host memory about 827m and don't appear memory leak.

Mem:   7879396k total,  1876656k used,  6002740k free,    18532k buffers
Swap:  1048568k total,    14948k used,  1033620k free,   854036k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                    
21945 root      20   0 2844m 827m 5056 S  0.7 10.8   2:19.41 qemu-kvm 

additional info: I tested Fedora 16 and rhel6.2 guest, rhel6.2 haven't this issue. 

base on above testing result, I think this bug is fixed.

Comment 9 David Jaša 2012-03-20 15:48:28 UTC
Hi XiangChun, could you also update the bug state to VERIFIED so the z-stream process can start ASAP? Thank you.

Comment 12 Michal Novotny 2012-05-04 09:58:48 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause:
Missing free in loading and saving KVM registers.

Consequence:
When doing many migrations, the guest memory leaks a lot.

Fix:
Freeing of xSave registers has been added.

Result:
Guest doesn't memory leak anymore.

Comment 13 Alex Williamson 2012-05-04 13:36:54 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,11 +1,11 @@
 Cause:
-Missing free in loading and saving KVM registers.
+Missing free in managing xSave processor state.
 
 Consequence:
-When doing many migrations, the guest memory leaks a lot.
+qemu-kvm leaks memory when guest makes use of processor xSave functionality.
 
 Fix:
-Freeing of xSave registers has been added.
+Free buffers used for managing xSave support.
 
 Result:
-Guest doesn't memory leak anymore.+qemu-kvm no longer leaks memory.

Comment 14 errata-xmlrpc 2012-06-20 11:39:15 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2012-0746.html


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