<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-NZ link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi John,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>From memory (pun unintended) those 2 reported links are normal.&nbsp;
As i recall reading somewhere (I thought it was the FAQ File for FastMM, but
just had a very quick check and couldn&#8217;t see it mentioned) that it is normal
for those 2 items to be reported as memory leaks when doing the FullDebugMode.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>As i have the same leaks reported on my programs when debugging.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Cheers<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Anthony.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'> delphi-bounces@delphi.org.nz
[mailto:delphi-bounces@delphi.org.nz] <b>On Behalf Of </b>John Bird<br>
<b>Sent:</b> Wednesday, 3 March 2010 12:09 p.m.<br>
<b>To:</b> NZ Borland Developers Group - Delphi List<br>
<b>Subject:</b> [DUG] FastMM<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>I decided to try some memory leak testing on a couple of programs
to be sure all is OK, and after googling figured that even though I have d2007
the best was to download FastMM4 from source forge</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>This is what I figured to do to run the tests - anyone can correct
me if I am wrong:</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>1 - Add Uses FastMM in ...\Components\FastMM\FastMM4.pas as the
first used unit in the .DPR file.&nbsp;&nbsp; note I just edited the .DPR file
manually.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>2 - in the main form create add a line</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>&nbsp;&nbsp;&nbsp; ReportMemoryLeaksOnShutdown :=
true;&nbsp;&nbsp;&nbsp; //#### FastMM diagnostics if enabled</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>3 - Edit the FastMM4Options.Inc file to set </span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>&nbsp;get an error on startup.}<br>
{$define FullDebugMode}</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>[Note the program is a lot slower with this in]</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>4 - Add to Project compile options&nbsp; Debug Dcu's, generate
debug info,&nbsp;&nbsp; local symbols,&nbsp; reference info, use debug DCU's</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Add to Project link options include TD32 debug info</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>I know not all of these are needed, but not being sure which I
just turned them all on.</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>5 - I found I had to add to each project search path </span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>..\Components\FastMM&nbsp;&nbsp; otherwise it could not
find&nbsp;&nbsp; FastMM4Messages.pas or FastMM4Messages.dcu</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>even though that folder was in the IDE global setting
Tools/Options/Delphi options/Library - Win32/Browsing Path</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>All that done,&nbsp; to my relief I got a message that the only
leaks were one TFileStream, and one AnsiString<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>&quot;This application has leaked memory. The small block leaks
are (excluding expected leaks registered by pointer):<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>5 - 12 bytes: TFileStream x 1<br>
21 - 36 bytes: AnsiString x 1<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Note: Memory leak detail is logged to a text file in the same
folder as this application. To disable this memory leak check, undefine
&quot;EnableMemoryLeakReporting&quot;.&quot;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>This program does open and close a lot of files with
TFileStream,&nbsp;&nbsp; (note I do all my fileopens with a library routine
that also saves a reference number, the open mode, and the filename, and so far
they all seem to be closed properly- but I am checking to be sure).<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>I haven't yet figured out the culprit, anyone have any hints on
how to track them down, puzzled at the Ansistring one - what does that mean, as
I thought strings do not get memory leaks, being reference counted.&nbsp; There
are certainly way more than one string in the project.<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>&nbsp;<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Also I got a garbaged Project file - ended up with lines like:<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\CFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\CoFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\ComFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\CompFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\CompoFastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\ComponeFastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\ComponeneFastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\ComponenenFastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\ComponenentFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\ComponenentsFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\ComponenFastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\ComponenntsFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\ComponentFastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\ComponentsFastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\Components\FaFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\Components\FasFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\Components\FastFastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\Components\FastMFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\Components\FastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\Components\FastMMFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\Components\FastMM\FastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\Components\FastMM\FastMM4.Pas&quot; /&gt;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;==== this is the right one<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference
Include=&quot;..\Components\FFastMM.Pas&quot; /&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\ComponFastMM.Pas&quot;
/&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;DCCReference Include=&quot;..\FastMM.Pas&quot; /&gt;</span><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>&nbsp;<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'>Anyone come across this?&nbsp; Is it from anything I did wrong?<o:p></o:p></span></p>

</div>

<div>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Arial","sans-serif";
color:black'><o:p>&nbsp;</o:p></span></p>

</div>

<div>

<p class=MsoNormal>John<o:p></o:p></p>

</div>

</div>

</body>

</html>