Hi All, I use heap trace utility to see if there are memory leak in my program. The source is here:
https://github.com/xrfang/fpcollection/blob/aefa04f0374c94298facd8d57d4a25dafe10b753/src/demos/cache/demo.lpr My problem is, at the beginning of the main program, I have a costant definition: const ITEM_COUNT = 5000000; If I set ITEM_COUNT to a small value, say 50 or 5000, everything is OK, no memory leak. But with the above value, it will cause HEAPTRC to fall in an endless loop, generating messages like: Call trace for block $00007F41693AA680 size 40 $000000000040071F line 29 of demo.lpr $0000000000400180 While line 29 is this: 27 for i := 0 to ITEM_COUNT - 1 do begin 28 for j := 0 to 4 do key[j] := $deadbeef + i + j; 29 h.Add(@key, SizeOf(PtrUInt) * 5, Pointer($deadbeef + i)); 30 end; Could anyone tell me why heaptrc will fall in an endless loop, and does my program have memory leak? Thanks! Xiangrong
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal