Re: do you ever found memory leak with STL?

From: John Harrison (john_andronicus_at_hotmail.com)
Date: 07/26/04


Date: Mon, 26 Jul 2004 08:04:01 +0100

On Mon, 26 Jul 2004 14:52:03 +0800, rokia <rokiadd@yahoo.com.cn.discuss>
wrote:

>
> I found many people encounter this problem.
>
> and someone say that it's STL strategy.
>
> but I dont know when will it release those memory.
>
> BoundCheck report there are many memory leak when I use vector to
> push_back
> thousands class.
>
> any advice?
>

Post the code that you say is leaking memory. And specify which compiler
you are using. Then we might be able to tell you whether the leak is real
or not.

I recall that BoundsChecker reports non-existant memory leaks with the STL
that comes with VC++ 6. But equally you could have made a mistake and
BoundsChecker is reporting genuine memory leaks.

Track the number of times that constructors and destructors are called for
you class. Obviously these totals should be the same, but don't forget to
include the copy cosntructors if you do this.

john



Relevant Pages

  • Urgent: How to find memory leaks? -- profiler???
    ... I'm using some APIs to create registry keys, then report some events ... to windows event viewer.Now my program runs from command prompt, ... but my program seems to have memory leaks. ...
    (microsoft.public.vb.winapi)
  • How to detect and remove memory leak?
    ... I'm using some APIs to create registry keys, then report some events ... to windows event viewer.Now my program runs from command prompt, ... but my program seems to have memory leaks. ...
    (microsoft.public.vb.winapi)
  • Re: Fastcode MM memory usage
    ... Good suggestion. ... {Set this option to enable reporting of memory leaks. ... {Set this option to require the presence of the Delphi IDE to report memory ... This option has no effect if the option "EnableMemoryLeakReporting" ...
    (borland.public.delphi.language.basm)
  • Re: dll trouble - final status
    ... | Just to give you a final report. ... | I am giving up the idea of connecting fortran and VB, ... | W98 is rather slow, but I am seriously thinking to replace XP with W98 on ... FPS4 is notorious for memory leaks. ...
    (comp.lang.fortran)
  • Re: How to detect and remove memory leak?
    ... > I'm using some APIs to create registry keys, then report some events ... > but my program seems to have memory leaks. ... Destroy>every< GDI object you have created unless the MSDN ... global variables are the reason for the developer to have lost control of ...
    (microsoft.public.vb.winapi)