Re: Memory leak...
From: msalters (Michiel.Salters_at_logicacmg.com)
Date: 02/15/05
- Next message: msalters: "Re: Special type of singleton needed"
- Previous message: Dietmar Kuehl: "Re: CString process '\0' in the middle of string"
- In reply to: deancoo: "Memory leak..."
- Next in thread: Peter Koch Larsen: "Re: Memory leak..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: msalters: "Re: Special type of singleton needed"
- Previous message: Dietmar Kuehl: "Re: CString process '\0' in the middle of string"
- In reply to: deancoo: "Memory leak..."
- Next in thread: Peter Koch Larsen: "Re: Memory leak..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|