473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

C# USER Objects Leak (10,000 Limit)

I'm working on an application that eventually crashes when the "USER Objects" reaches 10,000. I've gone through all the code and replaced:

Expand|Select|Wrap|Line Numbers
  1. object = null;
with
Expand|Select|Wrap|Line Numbers
  1. if(object != null)
  2.     object.dispose();
  3.  
  4. object = null;
  5.  
Is there a way to track the objects that aren't being disposed within a class?

Is there a way to loop through all objects within a class and dispose of all IDisposable objects?

Thanks,
Alan
Apr 16 '09 #1
2 7750
PRR
750 Expert 512MB
Setting a object to null does not help...
Expand|Select|Wrap|Line Numbers
  1. object = null;
  2.  
You could occasionally call
Expand|Select|Wrap|Line Numbers
  1.  System.GC.Collect(0, GCCollectionMode.Forced);
  2.                 System.GC.WaitForPendingFinalizers();
  3.                 System.GC.Collect(0, GCCollectionMode.Forced);
  4.  
assuming your objects are in generation 0...
Look into implementing IDisposable, MSDN
Apr 17 '09 #2
Thanks,

My problem turned out to be buttons being added to an ArrayList and never being disposed of. It's kiosk based survey software that I didn't write, lots of code to dig through.
Apr 26 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: RCCNH | last post by:
I am creating a Windows application using C# in .NET. In one of the windows, I have to show a scrollable list of user objects. Those user objects contain various controls themselves (textbox,...
1
by: schmighty | last post by:
I can't find in Help the name of the file one can modify so that when debugging, the cursor pops up the value of the variable/value of the user defined object it is hovering over. Beats me how I...
1
by: Jimmy | last post by:
Hi I am trying to get a nice layout for my user objects and other webcontrols. I have an asp:table with all the webobjects in here but it still looks messy.. Any tips? ch Jimmy
0
by: Roland | last post by:
I have written a VB.NET WinForms App and on testing I found out about having a problem with the USER-Objects! If I open many Forms, they reach about 10.000 (To see in the Task-Manager) Is...
0
by: Brian Keating | last post by:
hi there i've a test program that creates a treeview and destroys it over and over, i keep track of the gdi object count for the process and see if they are ok. However when i switch on...
3
by: jofo | last post by:
Hello all, I am working on a multiuser access db. I want to have people login and then store their user information in an object. I want to store the information because it will be used in...
0
by: sergio ronchi | last post by:
I have two distinct .NET component having a UI containg a datagridView with some icons in some cells. The two components, that are very similar, are loaded by a COM application. The COM...
2
by: Grant Schenck | last post by:
This seems like is should be straight forward but I'm just not getting it. I have a very simple class (see below) which I think should be XML serializable. I have this class defined in my simple...
2
by: Anthony Smith | last post by:
I have a user object that is set when a user logs in. There are also permissions that I get about the user from a web service. Currently I take the results from those web services and store them as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.