473,663 Members | 2,738 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Memory release after form close

HI,
In my windows application (VB.NET) when I open a form the memory is
increasing but When I close it the memory doen't decrease (task manager).
each time I close the form and re-open it the memory is increasing.
with the time the machine (512 MO) become slow.
Is there a way to release the memory when closing the form.
Thanks
Jun 27 '08 #1
3 4849
"touf" <to****@hotmail .comwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
HI,
In my windows application (VB.NET) when I open a form the memory is
increasing but When I close it the memory doen't decrease (task manager).
each time I close the form and re-open it the memory is increasing.
with the time the machine (512 MO) become slow.
Is there a way to release the memory when closing the form.
Thanks
Do you have any variables in your form that you reference outside the form.
If so, it may be that these variables are being recreated and then
rereferenced every time you open the form but because they are referenced
outside the form they're not being released when you close them.

Mike.
Jun 27 '08 #2
Touf,

The taskmanager is far from acurate, beside that, what is the problem with
used memory as there is enough to use.

As it is because of your systemadministr ator, then search for this on Google
while using the name Posseth, he has a nice routine (which spent some time),
that keeps system administrators happy. (It is not releasing more memory, as
it is often already released but not showed in taskmanager).

Cor

"touf" <to****@hotmail .comschreef in bericht
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
HI,
In my windows application (VB.NET) when I open a form the memory is
increasing but When I close it the memory doen't decrease (task manager).
each time I close the form and re-open it the memory is increasing.
with the time the machine (512 MO) become slow.
Is there a way to release the memory when closing the form.
Thanks
Jun 27 '08 #3
Are you sure one of the components or variabels of your form are used
outside the form ?
have you implemented the using stament with your form ?
You can always force a GC and retrim the proces working setsize, but if
your objects are not marked for collection this will only degrade the
perfomance of your app . see this thread for the code
http://groups.google.nl/group/micros...90d59018060454
If you can`t find the problem another solution could be to use seperate
application domains as you have the possibility to unload them and this will
give you the resources back .

HTH

Michel

"touf" <to****@hotmail .comschreef in bericht
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
HI,
In my windows application (VB.NET) when I open a form the memory is
increasing but When I close it the memory doen't decrease (task manager).
each time I close the form and re-open it the memory is increasing.
with the time the machine (512 MO) become slow.
Is there a way to release the memory when closing the form.
Thanks

Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
3473
by: pete | last post by:
Can anyone give me some sugguestions here. Connection is declared at the start of the application Set rsFZReport.ActiveConnection = conn Then a function repeatly opens recordsets like this - rsFZReport.Open sRS, , adOpenStatic, adLockReadOnly, adCmdText .. ..
2
422
by: Jarvis | last post by:
I've made a testing program to test the memory usage of some Data Forms. I create a MDI parent form with one single MDI child form, which is a Data Form generated by .NET Data Form Wizard. To test the stuff, I keep to open that child data form for about 10 times. the memory usage shown in GC and task manager both increase. Then I close all those forms. and perform GC collect. The memory usage shown in GC falls, however, the memory...
2
5772
by: JosR | last post by:
I have a memory problem when running a VB.Net application. The application uses a from frmMain from which another form can be opened: Private Sub OpenTheNewForm() dim frm as New frmSecondform frm ShowDialog() End Sub At some point in time the second form is closed and the program returns to the main form frmMain:
16
2878
by: Justin Lazanowski | last post by:
Cross posting this question on the recommendation of an I have a .NET application that I am developing in C# I am loading information in from a dataset, and then pushing the dataset to a grid, or other controls depending on the particular form. This application is setup with one MDI parent calling MDI children with the exception of one Modal form (the report viewer). When I run the application and run one of the screens that pulls...
9
2341
by: Mike P | last post by:
I know everything about reference counting and making sure you don't have large objects lying around. I have also profiled my app with multiple tools. I know about the fact GC collects memory but not necessary give it back to the OS. It seems that .NET win app will only return memory to the OS when the OS is asking for it. But!!! When the OS is asking for it is usually too late, tons of swapping and slow performance.
3
3326
by: Marc | last post by:
I am using Visual Studio 2003 with .NET Framework 1.x on XP SP2. I am executing the following code (see also http://dturini.blogspot.com/2004/06/on-past-few-days-im-dealing-with-som e.html) HttpWebRequest wr = (HttpWebRequest)WebRequest.Create("http://www.microsoft.com/"); using (HttpWebResponse wrp = (HttpWebResponse)wr.GetResponse()) { using (Stream s = wrp.GetResponseStream())
11
3161
by: Alex | last post by:
Hello all, I have a main form(say "form1") .i want to display another form(say "form2") on occuring of an event (say a button click) and want to hide it after some time so that it will again displays while occuring of the same event.I develop it by creating an object of the form2 and displays it in the event by calling form2.Show() and hide it by calling form2.Hide(). the problem is that while displaying the form2 the memory usage of...
8
11656
by: jimmarq | last post by:
I have a button click event on my main application window that opens a form. The form has a lot of controls, loads a lot of data, and uses a lot of memory. When I close the form the memory is no deallocated. Every time I open the form, 7 megabytes of RAM and 7 megabytes of virtual memory are eaten up. Here are the only lines of code in the button click event: Dim frminv As New FrmInvoice() frminv.MdiParent = Me...
2
4820
by: mina | last post by:
hi i am using vb.net 2005 to my desktop application. my problem is like this when i am running my project it occupies 100% cpu at 1st form load. then again it release memory upto 95%. when i am calling new / loading another form it agein occuipes 100% cpu or near about it. While loading each form i am doing like this: me.close me.dispose
0
8436
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8548
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8634
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6186
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4349
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.