|
Boost Users : |
From: Klaim (mjklaim_at_[hidden])
Date: 2008-01-20 05:13:33
Hello,
I tested the MVS memory leak detector few months ago and it don't seem
return the allocation file path until you use "malloc" instead of "new". (at
least in my tests - tried with an empty application) It's a shame.
Anyway, there is another way to add more informations if you can run your
application with exactly the same state twice. I discovered it maybe 30
minutes ago and it worked well for my case.
As stated there :
http://www.oneunified.net/blog/Personal/SoftwareDevelopment/MemoryLeakDetection.article
and there : http://winter.eecs.umich.edu/soarwiki/Tracking_down_memory_leaks
you can add a breakpoint on a specific leaking memory allocation (between
brackets in the debug log) by setting _crtBreakAlloc variable to it's
allocation id
Like in the last link exemple, on the start of you main() :
#ifdef _MSC_VER
//_crtBreakAlloc = 1828; // uncomment that line and set the leaking
memory allocation id instead of 1828
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif // _MSC_VER
The MSDN docs are not verry explicit about that ( neither for vc8 nor vc9 ).
Hope that helps.
Joël Lamotte.
On Jan 20, 2008 9:13 AM, Serge Skorokhodov <serge.skorokhodov_at_[hidden]>
wrote:
> Jamie Cook wrote:
> > Hi all,
> >
> > I'm using the boost.test unit tests with memory leak detection turned on
>
> <skip>
>
> > Running 1 test case...
> > Detected memory leaks!
> > Dumping objects ->
> > {171} normal block at 0x00378B88, 1280 bytes long.
> > Data: < 7 lationStatis> A8 8D 37 00 6C 61 74 69 6F 6E 53 74 61 74 69
> 73
> > Object dump complete.
> >
> > My question is this... how can I enable more informative memory leak
> > output?
>
> <skip>
>
> It looks like standard output of MS debug runtime. How can it be
> improved? ;)
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net