Solved

Tab Controls Memory Leak?

Posted on 2011-03-15
5
797 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help with converting xml file to excel using VB.NET 3 25
C# Gridview 1 46
Function after success of Jquery/AJAX action 9 27
SSIS Start 2 20
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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