I am seeing an interesting memory issue with a winform in my application.
I've noticed everytime I show a form in my application, the memory usage
increases. When I close the form, the memory isn't released. The only time
the memory is released is when I "minimize" the application. Eventually,
overtime, my application consumes a good amount of memory.

Has anyone experienced this?

Thanks,

Yosh

Re: General Windows Forms and Memory Question by Herfried

Herfried
Tue Dec 06 10:59:10 CST 2005

"Yosh" <yoshi@nospam.com> schrieb:
>I am seeing an interesting memory issue with a winform in my application.
>I've noticed everytime I show a form in my application, the memory usage
>increases. When I close the form, the memory isn't released. The only time
>the memory is released is when I "minimize" the application. Eventually,
>overtime, my application consumes a good amount of memory.

Memory usage shown in Windows' task manager is not accurate for .NET-based
applications.

I suggest to take a look at this article:

The working set of an application is trimmed when its top-level window is
minimized
<URL:http://support.microsoft.com/?scid=kb;EN-US;293215>

In addition consider taking a look at the documentation chapters about
Garbage Collection.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Re: General Windows Forms and Memory Question by Yosh

Yosh
Tue Dec 06 11:58:01 CST 2005

Thank you for the information and article.

What is interesting is... my user claims the application, overtime, begins
to slow his pc (other applications) down as well. When they minimize the
application, then his pc (other applications) respond normally.

I know about GC but I am wondering if there is an issue or if I need to
manually do some memory cleanup to help solve this?

Thanks,

Yosh



"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:uHOVfZo%23FHA.2264@tk2msftngp13.phx.gbl...
> "Yosh" <yoshi@nospam.com> schrieb:
>>I am seeing an interesting memory issue with a winform in my application.
>>I've noticed everytime I show a form in my application, the memory usage
>>increases. When I close the form, the memory isn't released. The only time
>>the memory is released is when I "minimize" the application. Eventually,
>>overtime, my application consumes a good amount of memory.
>
> Memory usage shown in Windows' task manager is not accurate for .NET-based
> applications.
>
> I suggest to take a look at this article:
>
> The working set of an application is trimmed when its top-level window is
> minimized
> <URL:http://support.microsoft.com/?scid=kb;EN-US;293215>
>
> In addition consider taking a look at the documentation chapters about
> Garbage Collection.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>



Re: General Windows Forms and Memory Question by TP

TP
Tue Dec 06 16:52:23 CST 2005

Task manager is as accurate for .NET applications as it is
for non-.NET applications.

It shows the Working Set of each process, as well as
the Private Bytes for each process. (need to tell it to display
the VM Size column to see Private Bytes)

.NET Winforms apps are great, but the thing MS fails to
mention is that they allocate much more memory for
working set, private bytes, and virtual bytes than
most other (older) technologies.

In environments where there is plenty of excess RAM and
few .NET winforms apps it doesn't matter much. When
.NET winforms apps become more common I think people will
start to notice that they need to install more and more
memory to accomplish the same thing.

I do a lot of work with terminal server, and when running .NET
winforms applications I may need to have *several times* more
RAM to support the same number of concurrent users.

It would not surprise me if in a couple of years we see 1GB of
RAM as the recommended *minimum* for a desktop PC.

-TP

Herfried K. Wagner [MVP] wrote:
> "Yosh" <yoshi@nospam.com> schrieb:
>> I am seeing an interesting memory issue with a winform in my
>> application. I've noticed everytime I show a form in my application,
>> the memory usage increases. When I close the form, the memory isn't
>> released. The only time the memory is released is when I "minimize"
>> the application. Eventually, overtime, my application consumes a
>> good amount of memory.
>
> Memory usage shown in Windows' task manager is not accurate for
> .NET-based applications.
>
> I suggest to take a look at this article:
>
> The working set of an application is trimmed when its top-level
> window is minimized
> <URL:http://support.microsoft.com/?scid=kb;EN-US;293215>
>
> In addition consider taking a look at the documentation chapters about
> Garbage Collection.

Re: General Windows Forms and Memory Question by Herfried

Herfried
Tue Dec 06 17:31:30 CST 2005

"TP" <tperson.knowspamn@mailandnews.com> schrieb:
> Task manager is as accurate for .NET applications as it is for non-.NET
> applications.
>
> It shows the Working Set of each process, as well as the Private Bytes for
> each process. (need to tell it to display the VM Size column to see
> Private Bytes)

That's true. What I wanted to say is that the application doesn't
necessarily occupy the whole working set internally and that the GC might
free some of the memory if other applications requre additional memory.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>