<u></u>





<div 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" target="_blank">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>&quot;&quot;&quot;</div>
<div>src_image = canvas_get_image(canvas, copy-&gt;src_bitmap, FALSE);<br clear="all">
<div> </div>
<div>pixman_image_unref(src_image);</div>
<div>&quot;&quot;&quot;<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;min-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-right:8px;padding-left:8px;padding-top:8px;font-size:12px;background:#efefef;padding-bottom:8px">
<div><b>From:</b> <a href="mailto:marcandre.lureau@gmail.com" target="_blank">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" target="_blank">徐舫</a></div>
<div><b>CC:</b> <a href="mailto:spice-devel@lists.freedesktop.org" target="_blank">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, 徐舫 &lt;<a href="mailto:xufango@gmail.com" target="_blank">xufango@gmail.com</a>&gt; wrote:</div>
<div>&gt; 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&#39;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></div>