Re: Looks like memory leak

From: German (german.koninin_at_crmDASHworldwideDOTnet)
Date: 10/14/04


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
>
>



Relevant Pages

  • Re: Is this a true statement?
    ... > If the managed heaps are NOT growing, ... > memory increase is due to the growing of the non managed portion. ... > So if your unmanaged memory consumption keeps growing, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: SQLServr.exe Process Memory Leak
    ... The memory usage by the SQLServr.exe process is not ... growing by the ridiculously fast rate it previously was. ... PS - great blog! ... >>> starts at about 15MB used RAM. ...
    (microsoft.public.windows.server.sbs)
  • Re: Memory management problem
    ... > actually we have a problem that the process size becomes ever growing ... > release this unused memory asap. ... >> that memory consumption will stop or it will go down. ... >> This is garbage collection at work. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Is this a true statement?
    ... >> If the managed heaps are NOT growing, ... >> memory increase is due to the growing of the non managed portion. ... >> So if your unmanaged memory consumption keeps growing, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Computers - growth in drives but not memory
    ... memory. ... Why is the disk size growing more than memory? ... does exist, but it's not common, yet. ... consumers want for the lowest sticker price possible. ...
    (misc.consumers)