Re: FastMM - Expected memory leaks



Pierre le Riche wrote:


Chosing the first version would make it relatively easy to detect if a leaks is an expected leak. Just walk the stack at the time of the leak and check if the given address is a return address on it.


FastMM4 only stores stack traces in FullDebugMode (Storing stack traces is slow and uses a lot of extra memory.) Both your suggestions seem to require stack traces. The leak checking has to work in performance mode as well, or it will be less useful than it is now.


Yes, this would require stack traces, but only if you want to filter out expected leaks this way.


But thinking a bit more I come to the conclusion that none of this filtering should be done within the memory manager, it has enough other things to handle. I would be easier programmingwise to do any kind of filtering on the leak report with an external program. One would not have to handle storage of the expected leak definitions within the memory manager and could use any kind of (possibly memory intensive) filtering approach. To be able to filter the way I want, the report would need to contain stack traces but that would have no additional effects on the MM itself.

One might possibly want to add some additional "markers" in the log file to make the parsing of it a bit more robust in the filter, but that is more or less trivial.

Regards,
Ulf
.



Relevant Pages

  • Re: Does This Leak Memory?
    ... Then there will be only one set of temporaries on the stack. ... Microsoft MVP, MCSD ... >> He claims that the two temporaries in the first case may leak memory. ... > class's copy constructor it'll affect both scenarios equally. ...
    (microsoft.public.vc.language)
  • Re: Does This Leak Memory?
    ... Then there will be only one set of temporaries on the stack. ... Microsoft MVP, MCSD ... >> He claims that the two temporaries in the first case may leak memory. ... > class's copy constructor it'll affect both scenarios equally. ...
    (microsoft.public.vc.atl)
  • Re: C++ in KMDF
    ... jump up one stack location are affected. ... I don't know because I've never had a memory leak in the ... I don't much care if verifier gets the wrong address because verifier ... leaks in years of driver writing. ...
    (microsoft.public.development.device.drivers)
  • Re: GetNetworkParams leak ?(WAS: \device cp handle leak)
    ... I have found that your leak is related to dynamically loading the DLL. ... You should never ever call alloca in a loop, as this might cause your stack to be blown. ...
    (microsoft.public.win32.programmer.kernel)