Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 816
  • Last Modified:

Tab Controls Memory Leak?

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
vbNewbie2009
Asked:
vbNewbie2009
  • 2
  • 2
1 Solution
 
Paul JacksonCommented:
Have you used AddHandler to add any event handlers to the tab events
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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
 
vbNewbie2009Author Commented:
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
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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
 
vbNewbie2009Author Commented:
Good advice, thank you!
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now