Solved

Tab Controls Memory Leak?

Posted on 2011-03-15
5
792 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
Comment Utility
Have you used AddHandler to add any event handlers to the tab events
0
 
LVL 85

Expert Comment

by:Mike Tomlinson
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Good advice, thank you!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now