<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18882">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#000000 size=2 face=Arial>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</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>This is what I figured to do to run 
the tests - anyone can correct me if I am wrong:</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>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.</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>2 - in the main form create add a 
line</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial>&nbsp;&nbsp;&nbsp; 
ReportMemoryLeaksOnShutdown := true;&nbsp;&nbsp;&nbsp; //#### FastMM diagnostics 
if enabled</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>3 - Edit the FastMM4Options.Inc file 
to set </FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial>&nbsp;get an error on 
startup.}<BR>{$define FullDebugMode}</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>[Note the program is a lot slower 
with this in]</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>4 - Add to Project compile 
options&nbsp; Debug Dcu's, generate debug info,&nbsp;&nbsp; local symbols,&nbsp; 
reference info, use debug DCU's</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial>Add to Project link options include 
TD32 debug info</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>I know not all of these are needed, 
but not being sure which I just turned them all on.</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>5 - I found I had to add to each 
project search path </FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial>..\Components\FastMM&nbsp;&nbsp; 
otherwise it could not find&nbsp;&nbsp; FastMM4Messages.pas or 
FastMM4Messages.dcu</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial>even though that folder was in the 
IDE global setting Tools/Options/Delphi options/Library - Win32/Browsing 
Path</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>All that done,&nbsp; </FONT><FONT 
color=#000000 size=2 face=Arial>to my relief I got a message that the only leaks 
were one TFileStream, and one AnsiString</DIV>
<DIV>&nbsp;</DIV>
<DIV>"This application has leaked memory. The small block leaks are (excluding 
expected leaks registered by pointer):</DIV>
<DIV>&nbsp;</DIV>
<DIV>5 - 12 bytes: TFileStream x 1<BR>21 - 36 bytes: AnsiString x 1</DIV>
<DIV>&nbsp;</DIV>
<DIV>Note: Memory leak detail is logged to a text file in the same folder as 
this application. To disable this memory leak check, undefine 
"EnableMemoryLeakReporting"."</DIV>
<DIV>&nbsp;</DIV>
<DIV>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).<BR></DIV>
<DIV>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.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Also I got a garbaged Project file - ended up with lines 
like:<BR></DIV></FONT>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\CFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\CoFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\CompFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\CompoFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComponeFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComponeneFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComponenenFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComponenentFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComponenentsFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComponenFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComponenntsFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComponentFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\ComponentsFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\Components\FaFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;DCCReference Include="..\Components\FasFastMM.Pas" 
/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\Components\FastFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;DCCReference Include="..\Components\FastMFastMM.Pas" 
/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference Include="..\Components\FastMM.Pas" 
/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\Components\FastMMFastMM.Pas" /&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;DCCReference Include="..\Components\FastMM\FastMM.Pas" 
/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference 
Include="..\Components\FastMM\FastMM4.Pas" /&gt;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;==== this is the right 
one<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference Include="..\Components\FFastMM.Pas" 
/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference Include="..\ComponFastMM.Pas" 
/&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;DCCReference Include="..\FastMM.Pas" 
/&gt;</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2 face=Arial>Anyone come across this?&nbsp; Is it 
from anything I did wrong?</DIV>
<DIV><BR></DIV></FONT>
<DIV>John</DIV></BODY></HTML>