Solved

Tab Controls Memory Leak?

Posted on 2011-03-15
5
800 Views
Last Modified: 2012-05-11
I'm running a test; have a Visual Studio 2010 app vb using 3.5 Framework.  There are 3 nested tab controls with various tabs on each.  When I build and execute the app the memory starts at 9400K and begins growing as I tab between the various tab pages/tab controls.  I stopped watching when the memory was 13000K.

I don't have any code yet built into the tab controls or pages so I'm not sure what would be causing a seeming memory leak with just the tab control shells and pages.  

Have you run across this before?...any ideas what may be causing this or how to avoid?
0
Comment
Question by:vbNewbie2009
  • 2
  • 2
5 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35142203
Have you used AddHandler to add any event handlers to the tab events
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 35142746
Just because memory grows doesn't mean there is a leak.

.Net is notoriously "greedy" with memory and the Garbage Collector sometimes does not clean up until it feels the system as a whole needs the memory.

When you CLOSE the app, does the memory get returned to the system?  If so, then there is no leak...
0
 
LVL 1

Author Comment

by:vbNewbie2009
ID: 35144191
jacko72: No AddHandler used for event handlers.

Idle Mind:  That does seem "greedy", and the memory is returned to the system upon closing the app.  Is there any way to prevent the greedy aspect of .Net or is this a standard phenomenon?
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 35144234
That is standard behavior.  You're definitely not the first one to be alarmed about the memory usage of your .Net app!  Rest assured that if the memory will be released when it is needed by other apps.  Forcing the garbage collector to clean up can sometimes be detrimental to performance as it is an expensive operation...I'd leave it alone if it isn't causing any problems (other than appearing bloated).
0
 
LVL 1

Author Closing Comment

by:vbNewbie2009
ID: 35144259
Good advice, thank you!
0

Featured Post

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
location of a form 2 32
Finding the IIS version 5 37
SSIS On fail action 5 48
Regarding swagger API 1 32
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 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