<!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>&nbsp;</DIV>
<DIV>1) I used Inspector&nbsp;XE&nbsp;2011 on RHEL6.1 analysis the memory leak 
problem.</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;Inspector XE 2011 can give the leak location but no 
call stack.</DIV>
<DIV>&nbsp;</DIV>
<DIV>2) I used most of the spice-gtk code except the spicy.c, and modify&nbsp;no 
code below the spice-widget.c.</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;Successfully compiled the code using MingW 
gcc&nbsp;on Windows.</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;Then I use 
C++&nbsp;memory&nbsp;leak&nbsp;detector(<A 
href="http://www.softwareverify.com/cpp-memory.php">http://www.softwareverify.com/cpp-memory.php</A>).</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp;Finally I get the memory leak call stack. </DIV>
<DIV>&nbsp;&nbsp;&nbsp; I also use C++ memory leak detector analysis spicec, 
spices has less memory leak as you said.</DIV>
<DIV>&nbsp;</DIV>
<DIV>I&nbsp;will&nbsp;continue&nbsp;to&nbsp;spend&nbsp;time on tracing and 
analysis the image cache mechanism.</DIV>
<DIV>&nbsp;</DIV>
<DIV>But as far as I known, as one image&nbsp;has been&nbsp;created, there is on 
place to reference the allocated image.</DIV>
<DIV>&nbsp;</DIV>
<DIV>So :</DIV>
<DIV>&nbsp;</DIV>
<DIV>"""</DIV>
<DIV>src_image = canvas_get_image(canvas, copy-&gt;src_bitmap, FALSE);<BR 
clear=all>
<DIV>&nbsp;</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>&nbsp;</DIV>
<DIV>Am I right?</DIV></DIV>
<DIV>&nbsp;</DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>

<DIV><SPAN>xufango</SPAN></DIV>
<DIV>&nbsp;</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>&nbsp;<A href="mailto:marcandre.lureau@gmail.com">Marc-André 
Lureau</A></DIV>
<DIV><B>Date:</B>&nbsp;2012-03-16&nbsp;23:24</DIV>
<DIV><B>To:</B>&nbsp;<A href="mailto:xufango@gmail.com">徐舫</A></DIV>
<DIV><B>CC:</B>&nbsp;<A 
href="mailto:spice-devel@lists.freedesktop.org">spice-devel</A></DIV>
<DIV><B>Subject:</B>&nbsp;Re: [Spice-devel] [bug spice-gtk] spice-gtk memory 
leak</DIV></DIV></DIV>
<DIV>
<DIV>On&nbsp;Fri,&nbsp;Mar&nbsp;16,&nbsp;2012&nbsp;at&nbsp;10:27&nbsp;AM,&nbsp;徐舫&nbsp;&lt;xufango@gmail.com&gt;&nbsp;wrote:</DIV>
<DIV>&gt;&nbsp;But&nbsp;the&nbsp;allocated&nbsp;memory&nbsp;does&nbsp;not&nbsp;free.</DIV>
<DIV>&nbsp;</DIV>
<DIV>According&nbsp;to&nbsp;massif,&nbsp;the&nbsp;memory&nbsp;usage&nbsp;becomes&nbsp;stable,&nbsp;but&nbsp;your</DIV>
<DIV>backtrace&nbsp;is&nbsp;correct,&nbsp;the&nbsp;biggest&nbsp;offender&nbsp;is&nbsp;image&nbsp;cache,&nbsp;which&nbsp;can</DIV>
<DIV>top&nbsp;150mb.&nbsp;I&nbsp;am&nbsp;not&nbsp;very&nbsp;familiar&nbsp;with&nbsp;the&nbsp;caching&nbsp;logic,&nbsp;so&nbsp;I&nbsp;can't</DIV>
<DIV>say&nbsp;whether&nbsp;this&nbsp;can&nbsp;be&nbsp;tuned&nbsp;to&nbsp;limit&nbsp;to&nbsp;a&nbsp;given&nbsp;amount.&nbsp;It&nbsp;could</DIV>
<DIV>also&nbsp;be&nbsp;that&nbsp;spice-gtk&nbsp;cache&nbsp;is&nbsp;buggy,&nbsp;because&nbsp;spicec&nbsp;seems&nbsp;to&nbsp;use&nbsp;a</DIV>
<DIV>little&nbsp;bit&nbsp;less&nbsp;(50mb).&nbsp;But&nbsp;I&nbsp;do&nbsp;tests&nbsp;manually,&nbsp;so&nbsp;my&nbsp;empirical</DIV>
<DIV>results&nbsp;may&nbsp;vary.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Also,&nbsp;running&nbsp;spicy&nbsp;under&nbsp;valgrind&nbsp;leak&nbsp;check&nbsp;tool&nbsp;shows&nbsp;quite&nbsp;clearly</DIV>
<DIV>that&nbsp;there&nbsp;is&nbsp;nothing&nbsp;being&nbsp;leaked&nbsp;directly&nbsp;from&nbsp;spice-gtk,&nbsp;it&nbsp;seems.</DIV>
<DIV>&nbsp;</DIV>
<DIV>regards</DIV>
<DIV>&nbsp;</DIV>
<DIV>--&nbsp;</DIV>
<DIV>Marc-André&nbsp;Lureau</DIV></DIV></BODY></HTML>