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

Memory management

I have a program that is working as the front end to SQL Server. But I
noticed that as the program runs, the momery use just keeps going up. At
first, I thought it was that I was running it through .NET, but then
that reasoning didn't make much sense.

I tried adding a button to dispose of everything, and close all
connections, but the memory use didn't really change. Right now im
blaming the way i went about opening new forms.

//
form.show
me.close
//

This is my first time with VB.NET and i think i placed too much faith on
the GC. Any help, advice, please any one..

*** Sent via Developersdex http://www.developersdex.com ***
Nov 21 '05 #1
2 1547
ng
I strongly recommend using a form variable, such as:
Dim frmM as frmMain

frmM = new frmMain
frmM.show()

Then when frmM is unloaded, all the code associated with it is unloaded
also. If you just load a form by its true name, only the visual portion
is unloaded, but all the code is still in memory. Eventually the .Net
garbage collector is supposed to dispense with those straggling code
blocks, but I don't have that much confidence in it. And who knows when
it will get around to it. If you are opening and closing forms rapidly,
you can easily overwhelm the poor thing.

Tom
Dagoberto Aceves wrote:
I have a program that is working as the front end to SQL Server. But I
noticed that as the program runs, the momery use just keeps going up. At
first, I thought it was that I was running it through .NET, but then
that reasoning didn't make much sense.

I tried adding a button to dispose of everything, and close all
connections, but the memory use didn't really change. Right now im
blaming the way i went about opening new forms.

//
form.show
me.close
//

This is my first time with VB.NET and i think i placed too much faith on
the GC. Any help, advice, please any one..

*** Sent via Developersdex http://www.developersdex.com ***

Nov 21 '05 #2
Dagoberto,

If you go to the newsgroup Microsoft.public.dotnet.general, than you will
see that that newsgroup is loaded with your question.

The problem is the TaskManager which most people are using to see the
memory. That function is not reliable.

The GC has to start working if there is memory needed in a kind of iddle
time. In fact it is working much more.

//
form.show
me.close
//
This procedure shows an existing form object, me close tells that the object
that is instanced with new as the running object has to be closed. It is for
sure not the form that you have showed.

I hope this gives some ideas

Cor
Nov 21 '05 #3

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

Similar topics

0
by: Richard Jones | last post by:
Garbage Collection & Memory Management Summer School 20-21 July 2004, Canterbury, UK The performance of today's memory-hungry applications depends on efficient dynamic memory management,...
2
by: DANIEL BEAULIEU J | last post by:
Basically i am a student taking an operating systems course which is c++ intensive. Familiar with Java, and so not so familiar with memory management. Looking for suggestions of exercises or web...
9
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...
8
by: Chad | last post by:
hello, i am losing memory each time i make this call to a C++ dll (I make frequent calls). 'in VB.Net Declare Function grab Lib "grabber.dll" _ (ByRef lpBuf As Byte, ByVal lnum As Integer)...
1
by: trialproduct2004 | last post by:
Hi all, I am having slight confusion regarding memory management in .net. Say suppose i have two application one is in C# and other is in MFC(VC++). Both of this application are using lots...
0
by: erez_acount | last post by:
***************************************************************************** Call For Papers The 2006 International Symposium on Memory Management (ISMM'06) Co-located with PLDI 2006 ...
94
by: smnoff | last post by:
I have searched the internet for malloc and dynamic malloc; however, I still don't know or readily see what is general way to allocate memory to char * variable that I want to assign the substring...
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
9
by: benoit808 | last post by:
I don't have a lot of experience with C++ so I apologize if this is a stupid question. I use Paul Nettle's memory manager (mmgr.cpp) which reports a memory leak but I don't think there's one. Here...
5
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but we believe that it might be related to the OS...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.