Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Small memory leaks and call stack in RB 6.03

edited June 2003 in General

Hi,

With version 6.03 and Delphi 4 I get a few memory leaks in

procedure TppEngine.DataPipelineStateToRec(aDataPipeline:
TppDataPipeline; var aRec: TppDataPipelineSaveRec);
...
aRec.FBookmark := Longint(aDataPipeline.GetBookmark);
...

In some cases FreeBookmarkk is not called.

Below are three different call stacks which generated the leak.

I am not sure if I should try to fix the leaks myself or if this is a
known issue, but I cannot ugprade to version 7 because I still have to
unfortunately still use Delphi 4.

Best regards,

Michel

---

Leak #0 - 1 occurence(s) - USER c:\Temp\MemCheck.log.$$$ call
stack -1 : 000ACE78 Module ppEngine.pas Routine
TppEngine.DataPipelineStateToRec Line 3300
call stack -2 : 000A9D69 Module ppEngine.pas Routine
TppEngine.SaveEngineState Line 1538
call stack -3 : 000A9889 Module ppEngine.pas Routine
TppEngine.FinishPage Line 1351
call stack -4 : 000A865E Module ppEngine.pas Routine
TppEngine.GeneratePage Line 656
call stack -5 : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -6 : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -7 : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -8 : 000C6148 Module ppSubRpt.pas Routine
TppSubReport.GenerateReport Line 1519
call stack -9 : 000C67B0 Module ppSubRpt.pas Routine
TppSubReport.GenerateChild Line 1759
call stack -: : 000C5AC2 Module ppSubRpt.pas Routine
TppSubReport.CalcSpaceUsed Line 1239
call stack -; : 000DC4BB Module ppStrtch.pas Routine
TppStretchable.CalcPrintPosition Line 1138
call stack -< : 000DC2E8 Module ppStrtch.pas Routine
TppStretchable.Generate Line 1062
call stack -= : 000E3DFD Module ppBands.pas Routine
TppCustomBand.ProcessQueue Line 3434
call stack -> : 000E3BF7 Module ppBands.pas Routine
TppCustomBand.GenerateObjects Line 3355
call stack -? : 000E359E Module ppBands.pas Routine
TppCustomBand.Generate Line 3105
call stack -@ : 000A8C3D Module ppEngine.pas Routine
TppEngine.GenerateBands Line 900
call stack -A : 000A8559 Module ppEngine.pas Routine
TppEngine.GeneratePage Line 625
call stack -B : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -C : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -D : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -E : 001252AE Module ppReport.pas Routine
TppReport.RequestPage Line 1739
call stack -F : 00105A8D Module ppDevice.pas Routine
TppPublisher.DoOnPageRequest Line 1152
call stack -G : 0010582D Module ppDevice.pas Routine
TppPublisher.Publish Line 1010
call stack -H : 0010678B Module ppDevice.pas Routine
TppDevice.MakePageRequest Line 1894
call stack -I : 000F0243 Module ppViewr.pas Routine
TppScreenDevice.GotoPage Line 1439
call stack -J : 000EF5EB Module ppViewr.pas Routine
TppViewer.NextPage Line 941


Leak #1 - 1 occurence(s) - USER c:\Temp\MemCheck.log.$$$ call
stack -1 : 000ACE78 Module ppEngine.pas Routine
TppEngine.DataPipelineStateToRec Line 3300
call stack -2 : 000A9D69 Module ppEngine.pas Routine
TppEngine.SaveEngineState Line 1538
call stack -3 : 000A9889 Module ppEngine.pas Routine
TppEngine.FinishPage Line 1351
call stack -4 : 000A865E Module ppEngine.pas Routine
TppEngine.GeneratePage Line 656
call stack -5 : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -6 : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -7 : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -8 : 000C6148 Module ppSubRpt.pas Routine
TppSubReport.GenerateReport Line 1519
call stack -9 : 000C67B0 Module ppSubRpt.pas Routine
TppSubReport.GenerateChild Line 1759
call stack -: : 000C5AC2 Module ppSubRpt.pas Routine
TppSubReport.CalcSpaceUsed Line 1239
call stack -; : 000DC4BB Module ppStrtch.pas Routine
TppStretchable.CalcPrintPosition Line 1138
call stack -< : 000DC2E8 Module ppStrtch.pas Routine
TppStretchable.Generate Line 1062
call stack -= : 000E3DFD Module ppBands.pas Routine
TppCustomBand.ProcessQueue Line 3434
call stack -> : 000E3BF7 Module ppBands.pas Routine
TppCustomBand.GenerateObjects Line 3355
call stack -? : 000E359E Module ppBands.pas Routine
TppCustomBand.Generate Line 3105
call stack -@ : 000A8C3D Module ppEngine.pas Routine
TppEngine.GenerateBands Line 900
call stack -A : 000A8559 Module ppEngine.pas Routine
TppEngine.GeneratePage Line 625
call stack -B : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -C : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -D : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -E : 001252AE Module ppReport.pas Routine
TppReport.RequestPage Line 1739
call stack -F : 00105A8D Module ppDevice.pas Routine
TppPublisher.DoOnPageRequest Line 1152
call stack -G : 0010582D Module ppDevice.pas Routine
TppPublisher.Publish Line 1010
call stack -H : 0010678B Module ppDevice.pas Routine
TppDevice.MakePageRequest Line 1894
call stack -I : 000F0243 Module ppViewr.pas Routine
TppScreenDevice.GotoPage Line 1439
call stack -J : 000EF5EB Module ppViewr.pas Routine
TppViewer.NextPage Line 941
call stack -1 : 000ACE78 Module ppEngine.pas Routine
TppEngine.DataPipelineStateToRec Line 3300
call stack -2 : 000A9D69 Module ppEngine.pas Routine
TppEngine.SaveEngineState Line 1538
call stack -3 : 000A9889 Module ppEngine.pas Routine
TppEngine.FinishPage Line 1351
call stack -4 : 000A8E4C Module ppEngine.pas Routine
TppEngine.GenerateBands Line 951
call stack -5 : 000A8559 Module ppEngine.pas Routine
TppEngine.GeneratePage Line 625
call stack -6 : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -7 : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -8 : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -9 : 000C6148 Module ppSubRpt.pas Routine
TppSubReport.GenerateReport Line 1519
call stack -: : 000C67B0 Module ppSubRpt.pas Routine
TppSubReport.GenerateChild Line 1759
call stack -; : 000C5AC2 Module ppSubRpt.pas Routine
TppSubReport.CalcSpaceUsed Line 1239
call stack -< : 000DC4BB Module ppStrtch.pas Routine
TppStretchable.CalcPrintPosition Line 1138
call stack -= : 000DC2E8 Module ppStrtch.pas Routine
TppStretchable.Generate Line 1062
call stack -> : 000E3DFD Module ppBands.pas Routine
TppCustomBand.ProcessQueue Line 3434
call stack -? : 000E3BF7 Module ppBands.pas Routine
TppCustomBand.GenerateObjects Line 3355
call stack -@ : 000E359E Module ppBands.pas Routine
TppCustomBand.Generate Line 3105
call stack -A : 000A8C3D Module ppEngine.pas Routine
TppEngine.GenerateBands Line 900
call stack -B : 000A8559 Module ppEngine.pas Routine
TppEngine.GeneratePage Line 625
call stack -C : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -D : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -E : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -F : 001252AE Module ppReport.pas Routine
TppReport.RequestPage Line 1739
call stack -G : 00105A8D Module ppDevice.pas Routine
TppPublisher.DoOnPageRequest Line 1152
call stack -H : 0010582D Module ppDevice.pas Routine
TppPublisher.Publish Line 1010
call stack -I : 001019D1 Module ppProd.pas Routine
TppProducer.PublishReport Line 1129
call stack -J : 00101A5B Module ppProd.pas Routine
TppProducer.PrintToDevices Line 1174


Leak #2 - 1 occurence(s) - USER c:\Temp\MemCheck.log.$$$ call
stack -1 : 000ACE78 Module ppEngine.pas Routine
TppEngine.DataPipelineStateToRec Line 3300
call stack -2 : 000A9D69 Module ppEngine.pas Routine
TppEngine.SaveEngineState Line 1538
call stack -3 : 000A9889 Module ppEngine.pas Routine
TppEngine.FinishPage Line 1351
call stack -4 : 000A865E Module ppEngine.pas Routine
TppEngine.GeneratePage Line 656
call stack -5 : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -6 : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -7 : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -8 : 000C6148 Module ppSubRpt.pas Routine
TppSubReport.GenerateReport Line 1519
call stack -9 : 000C67B0 Module ppSubRpt.pas Routine
TppSubReport.GenerateChild Line 1759
call stack -: : 000C5AC2 Module ppSubRpt.pas Routine
TppSubReport.CalcSpaceUsed Line 1239
call stack -; : 000DC4BB Module ppStrtch.pas Routine
TppStretchable.CalcPrintPosition Line 1138
call stack -< : 000DC2E8 Module ppStrtch.pas Routine
TppStretchable.Generate Line 1062
call stack -= : 000E3DFD Module ppBands.pas Routine
TppCustomBand.ProcessQueue Line 3434
call stack -> : 000E3BF7 Module ppBands.pas Routine
TppCustomBand.GenerateObjects Line 3355
call stack -? : 000E359E Module ppBands.pas Routine
TppCustomBand.Generate Line 3105
call stack -@ : 000A8C3D Module ppEngine.pas Routine
TppEngine.GenerateBands Line 900
call stack -A : 000A8559 Module ppEngine.pas Routine
TppEngine.GeneratePage Line 625
call stack -B : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -C : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -D : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -E : 001252AE Module ppReport.pas Routine
TppReport.RequestPage Line 1739
call stack -F : 00105A8D Module ppDevice.pas Routine
TppPublisher.DoOnPageRequest Line 1152
call stack -G : 0010582D Module ppDevice.pas Routine
TppPublisher.Publish Line 1010
call stack -H : 0010678B Module ppDevice.pas Routine
TppDevice.MakePageRequest Line 1894
call stack -I : 000F0243 Module ppViewr.pas Routine
TppScreenDevice.GotoPage Line 1439
call stack -J : 000EF5EB Module ppViewr.pas Routine
TppViewer.NextPage Line 941
call stack -1 : 000ACE78 Module ppEngine.pas Routine
TppEngine.DataPipelineStateToRec Line 3300
call stack -2 : 000A9D69 Module ppEngine.pas Routine
TppEngine.SaveEngineState Line 1538
call stack -3 : 000A9889 Module ppEngine.pas Routine
TppEngine.FinishPage Line 1351
call stack -4 : 000A8E4C Module ppEngine.pas Routine
TppEngine.GenerateBands Line 951
call stack -5 : 000A8559 Module ppEngine.pas Routine
TppEngine.GeneratePage Line 625
call stack -6 : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -7 : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -8 : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -9 : 000C6148 Module ppSubRpt.pas Routine
TppSubReport.GenerateReport Line 1519
call stack -: : 000C67B0 Module ppSubRpt.pas Routine
TppSubReport.GenerateChild Line 1759
call stack -; : 000C5AC2 Module ppSubRpt.pas Routine
TppSubReport.CalcSpaceUsed Line 1239
call stack -< : 000DC4BB Module ppStrtch.pas Routine
TppStretchable.CalcPrintPosition Line 1138
call stack -= : 000DC2E8 Module ppStrtch.pas Routine
TppStretchable.Generate Line 1062
call stack -> : 000E3DFD Module ppBands.pas Routine
TppCustomBand.ProcessQueue Line 3434
call stack -? : 000E3BF7 Module ppBands.pas Routine
TppCustomBand.GenerateObjects Line 3355
call stack -@ : 000E359E Module ppBands.pas Routine
TppCustomBand.Generate Line 3105
call stack -A : 000A8C3D Module ppEngine.pas Routine
TppEngine.GenerateBands Line 900
call stack -B : 000A8559 Module ppEngine.pas Routine
TppEngine.GeneratePage Line 625
call stack -C : 000A8815 Module ppEngine.pas Routine
TppEngine.RestorePage Line 741
call stack -D : 000A8249 Module ppEngine.pas Routine
TppEngine.Generate Line 498
call stack -E : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -F : 001252AE Module ppReport.pas Routine
TppReport.RequestPage Line 1739
call stack -G : 00105A8D Module ppDevice.pas Routine
TppPublisher.DoOnPageRequest Line 1152
call stack -H : 0010582D Module ppDevice.pas Routine
TppPublisher.Publish Line 1010
call stack -I : 001019D1 Module ppProd.pas Routine
TppProducer.PublishReport Line 1129
call stack -J : 00101A5B Module ppProd.pas Routine
TppProducer.PrintToDevices Line 1174
call stack -1 : 000ACE78 Module ppEngine.pas Routine
TppEngine.DataPipelineStateToRec Line 3300
call stack -2 : 000A9D69 Module ppEngine.pas Routine
TppEngine.SaveEngineState Line 1538
call stack -3 : 000AAE24 Module ppEngine.pas Routine
TppEngine.Init Line 2105
call stack -4 : 000C6059 Module ppSubRpt.pas Routine
TppSubReport.StartOfMainReport Line 1462
call stack -5 : 00116A4C Module ppClass.pas Routine
TppBand.StartOfMainReport Line 5756
call stack -6 : 00111CC4 Module ppClass.pas Routine
TppCustomReport.StartOfMainReport Line 2457
call stack -7 : 00124EE7 Module ppReport.pas Routine
TppReport.StartOfMainReport Line 1553
call stack -8 : 000AABD5 Module ppEngine.pas Routine
TppEngine.Init Line 2012
call stack -9 : 000A8224 Module ppEngine.pas Routine
TppEngine.Generate Line 483
call stack -: : 000A8137 Module ppEngine.pas Routine
TppEngine.RequestPage Line 448
call stack -; : 001252AE Module ppReport.pas Routine
TppReport.RequestPage Line 1739
call stack -< : 00105A8D Module ppDevice.pas Routine
TppPublisher.DoOnPageRequest Line 1152
call stack -= : 0010582D Module ppDevice.pas Routine
TppPublisher.Publish Line 1010
call stack -> : 001019D1 Module ppProd.pas Routine
TppProducer.PublishReport Line 1129
call stack -? : 00101A5B Module ppProd.pas Routine
TppProducer.PrintToDevices Line 1174
call stack -@ : 0012519F Module ppReport.pas Routine
TppReport.PrintToDevices Line 1702
call stack -A : 0021D1D7 Module ppDsgner.pas(no debug info) Line 3201
call stack -B : 0021CE05 Module ppDsgner.pas Routine
TppDesignerWindow.SetPageActive Line 3076
call stack -C : 0021CCAD Module ppDsgner.pas Routine
TppDesignerWindow.pgcDesignerChange Line 3023
call stack -D : 00083D5B Routine TCustomTabControl.Change
call stack -E : 000387C3 Routine TControl.Perform
call stack -F : 0003B29C Routine DoControlMsg
call stack -G : 0004E4A4 (no debug info)
call stack -H : 0003AE53 Routine TWinControl.MainWndProc
call stack -I : 0004B8BA Routine StdWndProc
call stack -J : 77A3A240 (no debug info)

Comments

  • edited June 2003
    Michael,

    Which QA tool are you using? We use Sleuth QA to test ReportBuilder and are
    very careful to fix any memory leaks we find. RB 6.03 should be leak free.

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2003


    Hi Nico,

    Sorry for the direct email. See my other post below for details on the
    the MemCheck leak checker.

    I have used MemProof (similar to Sleuth) and you need to run the
    application within another application, which is quite cumbersome, and
    sometimes leaks fall through the cracks...

    MemCheck comiles directly in the EXE and replaces Delphi's memory
    manager to check in the background in every compile/run/debug cycle and
    then simply opens notepad if there are leaks with the call stack. If
    there are no leaks the operation is transparent. Very simple, yet very
    effective.

    MemCheck is very accurate and the call stack is usually quite clear even
    in multithread applications which gave MemProof a hard time.

    My other post shows a very simple leak, where a TList is not freeing its
    contained objects. I did not take the time to research the first leak.

    Best regards,

    Michel


This discussion has been closed.