<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
        LINE-HEIGHT: 1.5; FONT-FAMILY: 微软雅黑; COLOR: #000080; FONT-SIZE: 10.5pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 9.00.8112.16441"></HEAD>
<BODY style="MARGIN: 10px">
<DIV>Thank you very much.</DIV>
<DIV> </DIV>
<DIV>1) I used Inspector XE 2011 on RHEL6.1 analysis the memory leak
problem.</DIV>
<DIV> Inspector XE 2011 can give the leak location but no
call stack.</DIV>
<DIV> </DIV>
<DIV>2) I used most of the spice-gtk code except the spicy.c, and modify no
code below the spice-widget.c.</DIV>
<DIV> Successfully compiled the code using MingW
gcc on Windows.</DIV>
<DIV> Then I use
C++ memory leak detector(<A
href="http://www.softwareverify.com/cpp-memory.php">http://www.softwareverify.com/cpp-memory.php</A>).</DIV>
<DIV> Finally I get the memory leak call stack. </DIV>
<DIV> I also use C++ memory leak detector analysis spicec,
spices has less memory leak as you said.</DIV>
<DIV> </DIV>
<DIV>I will continue to spend time on tracing and
analysis the image cache mechanism.</DIV>
<DIV> </DIV>
<DIV>But as far as I known, as one image has been created, there is on
place to reference the allocated image.</DIV>
<DIV> </DIV>
<DIV>So :</DIV>
<DIV> </DIV>
<DIV>"""</DIV>
<DIV>src_image = canvas_get_image(canvas, copy->src_bitmap, FALSE);<BR
clear=all>
<DIV> </DIV>
<DIV>pixman_image_unref(src_image);</DIV>
<DIV>"""<BR></DIV>
<DIV>pixman_image_unref will free the image and associated image data.</DIV>
<DIV> </DIV>
<DIV>Am I right?</DIV></DIV>
<DIV> </DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>xufango</SPAN></DIV>
<DIV> </DIV>
<DIV
style="BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0cm; PADDING-LEFT: 0cm; PADDING-RIGHT: 0cm; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<DIV
style="PADDING-BOTTOM: 8px; PADDING-LEFT: 8px; PADDING-RIGHT: 8px; BACKGROUND: #efefef; COLOR: #000000; FONT-SIZE: 12px; PADDING-TOP: 8px">
<DIV><B>From:</B> <A href="mailto:marcandre.lureau@gmail.com">Marc-André
Lureau</A></DIV>
<DIV><B>Date:</B> 2012-03-16 23:24</DIV>
<DIV><B>To:</B> <A href="mailto:xufango@gmail.com">徐舫</A></DIV>
<DIV><B>CC:</B> <A
href="mailto:spice-devel@lists.freedesktop.org">spice-devel</A></DIV>
<DIV><B>Subject:</B> Re: [Spice-devel] [bug spice-gtk] spice-gtk memory
leak</DIV></DIV></DIV>
<DIV>
<DIV>On Fri, Mar 16, 2012 at 10:27 AM, 徐舫 <xufango@gmail.com> wrote:</DIV>
<DIV>> But the allocated memory does not free.</DIV>
<DIV> </DIV>
<DIV>According to massif, the memory usage becomes stable, but your</DIV>
<DIV>backtrace is correct, the biggest offender is image cache, which can</DIV>
<DIV>top 150mb. I am not very familiar with the caching logic, so I can't</DIV>
<DIV>say whether this can be tuned to limit to a given amount. It could</DIV>
<DIV>also be that spice-gtk cache is buggy, because spicec seems to use a</DIV>
<DIV>little bit less (50mb). But I do tests manually, so my empirical</DIV>
<DIV>results may vary.</DIV>
<DIV> </DIV>
<DIV>Also, running spicy under valgrind leak check tool shows quite clearly</DIV>
<DIV>that there is nothing being leaked directly from spice-gtk, it seems.</DIV>
<DIV> </DIV>
<DIV>regards</DIV>
<DIV> </DIV>
<DIV>-- </DIV>
<DIV>Marc-André Lureau</DIV></DIV></BODY></HTML>