<!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> </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> </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. note I just edited the .DPR file manually.</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT> </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>
ReportMemoryLeaksOnShutdown := true; //#### FastMM diagnostics
if enabled</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT> </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> get an error on
startup.}<BR>{$define FullDebugMode}</FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT> </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> </DIV>
<DIV><FONT color=#000000 size=2 face=Arial>4 - Add to Project compile
options Debug Dcu's, generate debug info, local symbols,
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> </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> </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
otherwise it could not find 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> </DIV>
<DIV><FONT color=#000000 size=2 face=Arial>All that done, </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> </DIV>
<DIV>"This application has leaked memory. The small block leaks are (excluding
expected leaks registered by pointer):</DIV>
<DIV> </DIV>
<DIV>5 - 12 bytes: TFileStream x 1<BR>21 - 36 bytes: AnsiString x 1</DIV>
<DIV> </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> </DIV>
<DIV>This program does open and close a lot of files with
TFileStream, (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. There
are certainly way more than one string in the project.</DIV>
<DIV> </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> </DIV>
<DIV><FONT color=#000000 size=2 face=Arial> <DCCReference
Include="..\CFastMM.Pas" /><BR> <DCCReference
Include="..\CoFastMM.Pas" /><BR> <DCCReference
Include="..\ComFastMM.Pas" /><BR> <DCCReference
Include="..\CompFastMM.Pas" /><BR> <DCCReference
Include="..\CompoFastMM.Pas" /><BR> <DCCReference
Include="..\ComponeFastMM.Pas" /><BR> <DCCReference
Include="..\ComponeneFastMM.Pas" /><BR> <DCCReference
Include="..\ComponenenFastMM.Pas" /><BR> <DCCReference
Include="..\ComponenentFastMM.Pas" /><BR> <DCCReference
Include="..\ComponenentsFastMM.Pas" /><BR> <DCCReference
Include="..\ComponenFastMM.Pas" /><BR> <DCCReference
Include="..\ComponenntsFastMM.Pas" /><BR> <DCCReference
Include="..\ComponentFastMM.Pas" /><BR> <DCCReference
Include="..\ComponentsFastMM.Pas" /><BR> <DCCReference
Include="..\Components\FaFastMM.Pas" /><BR>
<DCCReference Include="..\Components\FasFastMM.Pas"
/><BR> <DCCReference
Include="..\Components\FastFastMM.Pas" /><BR>
<DCCReference Include="..\Components\FastMFastMM.Pas"
/><BR> <DCCReference Include="..\Components\FastMM.Pas"
/><BR> <DCCReference
Include="..\Components\FastMMFastMM.Pas" /><BR>
<DCCReference Include="..\Components\FastMM\FastMM.Pas"
/><BR> <DCCReference
Include="..\Components\FastMM\FastMM4.Pas" />
<==== this is the right
one<BR> <DCCReference Include="..\Components\FFastMM.Pas"
/><BR> <DCCReference Include="..\ComponFastMM.Pas"
/><BR> <DCCReference Include="..\FastMM.Pas"
/></FONT></DIV>
<DIV><FONT color=#000000 size=2 face=Arial></FONT> </DIV>
<DIV><FONT color=#000000 size=2 face=Arial>Anyone come across this? Is it
from anything I did wrong?</DIV>
<DIV><BR></DIV></FONT>
<DIV>John</DIV></BODY></HTML>