VB.NET memory usage / virtual memory size (big difference)

Posted on 2008-11-03
Medium Priority
Last Modified: 2012-06-21
I have an application that has 100's of threads in it of the same object...

According to the task manager:

Mem Usage = 231,260K
VM Size = 1,008,692K

This is a big difference & seems quite high.. is this normal? It can't need this much memory to run...

I also notice that when I minimize the program, "Mem Usage" goes down to around 30M and slowly crawls back up but VM Size remains the same.

I find it hard to believe my application needs this much memory to run, maybe I'm wrong...

Does .NET allocate extra memory it may never use? I'm worried about a VM error down the road the way this thing is hogging resources.
Question by:mcainc
  • 2

Expert Comment

ID: 22874500
There is a term "Working Set". When application is working and not minimized .NET CLR allocate some memory, but when application is minimized then memory is deallocated. You may use System.Diagnostics.Process.WorkingSet64 to see how much is it, and MaxWorkingSet and MinWorkingSet properites to control the working set.

Accepted Solution

ASliborsky earned 1500 total points
ID: 22875331

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month15 days, 17 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question