473,394 Members | 1,916 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,394 software developers and data experts.

Releasing Resources

1
Hi All,
Thank you in advance. I am having trouble releasing resources when I open a child form. Please see the code below.
Expand|Select|Wrap|Line Numbers
  1. Form f;
  2. private void button1_Click(object sender, EventArgs e)
  3. {
  4.     f = new Form2();
  5.     f.FormClosed += new FormClosedEventHandler(childForm_FormClosed);
  6.     f.Show();
  7. }
  8.  
  9. private void childForm_FormClosed(object sender, FormClosedEventArgs e)
  10. {
  11.     f.Dispose();
  12.     f = null;
  13. }
  14.  
  15.  
When I use ANTS profiler, it appears references to form2 are still active after I close form2. The live object count goes down but not as much as I would expect. The type of objects that are "living" are things like decimal, string, size, color, ..... Even if I force a GC they are "live".

Am I missing something here.

Thanks again.
Jan 2 '08 #1
0 867

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

Similar topics

4
by: lebo | last post by:
Hi I'm trying to understand how Python handles memory usage and dynamic object loading and unloading. Problem to solve? Build a very low memory footprint (non-GUI) Python application for...
0
by: Steve Guidi | last post by:
Hello, I'm developing an application that periodically reads embedded assembly resources. The resources are text-based, and are about 3-7KB in size, and the application accesses them by calling...
0
by: Phil | last post by:
I am using .NET Remoting for interaction between client/host. When my app. starts the aspnet_wp process goes from approx. 3mb to ~20mb. Each round-trip to the server adds anything from 6kb to 2.5mb...
7
by: trialproduct2004 | last post by:
Hi all I am having application in c# where i am loading one table of database into dataset. My table is of large size. so whenever i am loading that into dataset my memory size is getting...
5
by: Michael Tissington | last post by:
I have an application written in C++ (NOT .NET) which creates an instance of a vb .net object. My application releases the .net object when it has finished using it. However .NET GC is not...
0
by: Naved Ahmed | last post by:
In one of my project, I called ASP web service to convert some type of files. After conversion, web service is deleting that file. Still that file is shown by the windows Explorer (Even after...
2
by: Pete Smith | last post by:
I have written print application which prints multiple pages by calling PrintPage event multiple times. I am closing all the databases related objects resources when it is not required. Since...
3
by: ssylee | last post by:
For example, I have a BITMAPINFO* and a BYTE* object to release the resources. Would the most bulletproof way of doing so involve checking to see if they are null, then if they are not, invoke a...
2
by: enggwaqas | last post by:
Hi guys, I have a memory problem in my vb.net application. It's actually a point of sales system, which must be keep running the whole day. The problem is: application is not releasing any memory...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.