Bug 1730166 - memory leak when attach/detach a qcow2 based on nbd
Summary: memory leak when attach/detach a qcow2 based on nbd
Keywords:
Status: NEW
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.1
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Maxim Levitsky
QA Contact: CongLi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-07-16 03:52 UTC by Han Han
Modified: 2020-02-06 13:50 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)
the script, domain xml&cmdline, origin data, leak graph (218.49 KB, application/gzip)
2019-07-16 03:52 UTC, Han Han
no flags Details

Description Han Han 2019-07-16 03:52:18 UTC
Created attachment 1590970 [details]
the script, domain xml&cmdline, origin data, leak graph

Description of problem:
As subject

Version-Release number of selected component (if applicable):
libvirt-5.5.0-1.module+el8.1.0+3580+d7f6488d.x86_64
qemu-kvm-4.0.0-5.module+el8.1.0+3622+5812d9bf.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare running as copy.xml
2. Prepare a nbd server:
# qemu-nbd /tmp/a -x '32r5340034u34ui054iu*^&*_)$(@($*&#@&$&@#$&#&#)@*$()@#*$()#($*#@()$*#$*#*@*#@()(@#*$()*@#($*(@#*$(*@#*$#@*$*@#$@#*@#()*$#*@*$#@**][\]{}|{}{}{}|{{{|{{|{}|{}|{}|${|#{${#}{}${%}{$%{}|{%}{#$}|{%{#$}|%{}|${%}|{#$|%{|#$%|{#$|%{#$|' -t

3. Create the qcow2 backing file
# qemu-img create -b 'nbd:localhost:10809:exportname=32r5340034u34ui054iu*^&*_)$(@($*&#@&$&@#$&#&#)@*$()@#*$()#($*#@()$*#$*#*@*#@()(@#*$()*@#($*(@#*$(*@#*$#@*$*@#$@#*@#()*$#*@*$#@**][\]{}|{}{}{}|{{{|{{|{}|{}|{}|${|#{${#}{}${%}{$%{}|{%}{#$}|{%{#$}|%{}|${%}|{#$|%{|#$%|{#$|%{#$|' /var/lib/libvirt/images/n.qcow2 -f qcow2

4. Attach/detach the qcow2 disk for 1000 times. Just run the scripts as:
# ./main.py -e 'virsh attach-disk copy /var/lib/libvirt/images/n.qcow2 vdb --subdriver qcow2; sleep 1; virsh detach-disk copy vdb' -p "`pidof libvirtd qemu-kvm virtlogd qemu-nbd`" -c 1000

When that script finish, it will draw a ram usage graph as svg file. The graph is a typycal 'sawteeth' graph, which indicates memory leak in qemu-kvm. See the leak.svg

Actual results:
As above. About 48304128 Byte ram usage increased every 1000 cycles.

Expected results:
No memory leak

Additional info:

Comment 5 Ademar Reis 2020-02-05 23:00:44 UTC
QEMU has been recently split into sub-components and as a one-time operation to avoid breakage of tools, we are setting the QEMU sub-component of this BZ to "General". Please review and change the sub-component if necessary the next time you review this BZ. Thanks


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