Re: Memory leak...

From: msalters (Michiel.Salters_at_logicacmg.com)
Date: 02/15/05


Date: 15 Feb 2005 01:07:35 -0800


deancoo wrote:
> I'm pretty sure that the program bellow contains a memory leak.
After
> deleting the "hand_vector" instance, not all memory is released (only
about
> 30%). It appears to me as though the instances of "hand" are still
hanging
> around. Are they not on the heap? Shouldn't they be released along
with the
> "hand_vector" instance? Thanks for any help.

How do you know? A memory leak occurs when memory cannot be reused
within
the same program. You cannot determine that from the outside. Many STL
implementations will not return memory tot he OS, but keep it available
for the next allocation. That's not a memory leak. It's not just the
STL.
Even std::malloc( ) can do that.

HTH,
Michiel Salters



Relevant Pages

  • Memory leak...
    ... I'm pretty sure that the program bellow contains a memory leak. ... deleting the "hand_vector" instance, not all memory is released (only about ...
    (comp.lang.cpp)
  • Re: Memory leak...
    ... I think my use of Task Manager to ... > I'm pretty sure that the program bellow contains a memory leak. ... > class hand { ...
    (comp.lang.cpp)
  • Re: krb524 stops working (MIT 1.5.4 + 2007-005/6 patches + fakeka patch)
    ... probably because of a slow memory leak. ... The requests that incurred these increases and the 6 ... (where this example includes the requests for more heap space: ...
    (comp.protocols.kerberos)
  • Re: Memory Leak
    ... Virtual Call Stub Heap: ... LoaderCodeHeap: 05900000Size: 0x10000bytes. ... TotSize PctPctUsage ... the memory leak costs more than 1Gb of memory). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Wince application hangs
    ... but maybe a memory leak or handle leak. ... beitman AT applieddata DOT net ... running one applicatin which executes some tests (like SD/CF card ... hanging(Task bar and application is hanging. ...
    (microsoft.public.windowsce.platbuilder)