Re: Looks like memory leak
From: German (german.koninin_at_crmDASHworldwideDOTnet)
Date: 10/14/04
- Next message: Priyesh: "Re: key / value lookup"
- Previous message: Igor Tandetnik: "Re: Looks like memory leak"
- In reply to: Igor Tandetnik: "Re: Looks like memory leak"
- Next in thread: Igor Tandetnik: "Re: Looks like memory leak"
- Reply: Igor Tandetnik: "Re: Looks like memory leak"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 14 Oct 2004 16:14:57 +0200
The problem is that memory is not reusin, but growing. Each time I run my
method, each time it is groing for about 150k.
"Igor Tandetnik" <itandetnik@mvps.org> wrote in message
news:#jgwnZfsEHA.3740@tk2msftngp13.phx.gbl...
> "German" <german.koninin@crmDASHworldwideDOTnet> wrote in message
> news:%23NpW$8esEHA.2956@TK2MSFTNGP12.phx.gbl
> > My program that is using STL so much eat memory. So I created a new
> > one. Very simple MFC dialog based. That program contains one vector
> > as a member variable of CDialog class. Then I have some function that
> > fill it. In the beginning of that function is a .clear() method call.
> > When I run tht method first time it takes some memory (for container
> > i suppose). It is about 150k. After method running there is abou 150
> > records there in the container. The I call that method second time
> > and set a break point on .clear() call. the press F10. In Task
> > Manager I see that memory usage of mt program is the same before and
> > after clear() call. So it looks like vector is not cleared. I've
> > tried earse (begin(), end()), but the result is the same.
>
> The vector is cleared, the memory is simply not returned back to the OS.
> If you fill the vector again, it will use the memory already allocated
> earlier.
>
> The memory leak occurs if you repeat the same operation multiple times,
> and the memory consumption keeps growing. A memory jumping at the
> beginning and then remaining steady is a normal memory consumption
> pattern for a Windows application.
> --
> With best wishes,
> Igor Tandetnik
>
> "On two occasions, I have been asked [by members of Parliament], 'Pray,
> Mr. Babbage, if you put into the machine wrong figures, will the right
> answers come out?' I am not able to rightly apprehend the kind of
> confusion of ideas that could provoke such a question." -- Charles
> Babbage
>
>
- Next message: Priyesh: "Re: key / value lookup"
- Previous message: Igor Tandetnik: "Re: Looks like memory leak"
- In reply to: Igor Tandetnik: "Re: Looks like memory leak"
- Next in thread: Igor Tandetnik: "Re: Looks like memory leak"
- Reply: Igor Tandetnik: "Re: Looks like memory leak"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|