Have anyone tried this memcheck unit?,

I did a litle test in regular delphi project (I mean using Dpr, forms and unit1.pas), i added a button to the form and in the onclick button event i added:



Code:
procedure TForm1.Button1Click(Sender: TObject);
var
p:pointer;
begin
    getmem(p,64*1024);
end;
I have placed memchk procedure call in the form create event, then when the program is running, for each click in the button a 64kb memomy block is allocated; when i close the program the memcheck indeed informs me accurately the amount bytes allocated (and never released meanwhile the program was running); it also tells me that i used Getmem for allocate the memory however the unit is unable to show me where in my source code i am allocating that memory.

I have enabled the debugger and turned On the stack frames and all debug options in the project options (as the unit's documentation tells), then i tried again but still there is not easy way to found that the problem happen in my onclick code in unit1.pas, the debugger opens system.pas and stops in a line inside, seem procedure getmem() calls lot sub procedures/functions, in fact the checkmem reports 21 stacks calls, (mean since i click the button then about 21 procedures/functions are called in the procces).

Yes, knowing your program is leaking memory is very usefull, but also knowing where it happen in your code should be a MUST, specially in biggers projects like a video game;

how you guys usually found where you have the problem in your code?

thank you,

tp.