Click here to Skip to main content
15,902,635 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionGET CLIENT MACHINE DATE&TIME from server Pin
Karan_TN30-Jul-08 1:05
Karan_TN30-Jul-08 1:05 
AnswerRe: GET CLIENT MACHINE DATE&TIME from server Pin
Graham Bradshaw30-Jul-08 3:37
Graham Bradshaw30-Jul-08 3:37 
AnswerRe: GET CLIENT MACHINE DATE&TIME from server Pin
Bassam Saoud30-Jul-08 8:50
Bassam Saoud30-Jul-08 8:50 
QuestionReturning the number of items in a print queue Pin
James Bailey29-Jul-08 23:59
James Bailey29-Jul-08 23:59 
AnswerRe: Returning the number of items in a print queue Pin
Duncan Edwards Jones30-Jul-08 0:47
professionalDuncan Edwards Jones30-Jul-08 0:47 
GeneralRe: Returning the number of items in a print queue Pin
James Bailey30-Jul-08 1:08
James Bailey30-Jul-08 1:08 
QuestionMemory used by my Application increases at each click of a mouse Pin
Ashfaq Maniar29-Jul-08 23:53
Ashfaq Maniar29-Jul-08 23:53 
AnswerRe: Memory used by my Application increases at each click of a mouse Pin
Eduard Keilholz30-Jul-08 4:39
Eduard Keilholz30-Jul-08 4:39 
Erhm, there's this 'thing' called the Garbage Collector, this will clean up objects which are no longer in use. If thise 'collected' objects use loads of memory, that memory will be freed, and is available again. The garbage collector is very sophisticated and i'm pretty much sure it works fine for most applications. However, as programmer, you need to 'tell' the garbage collector which objects aren't used anymore. This way you will 'help' the garbage collector finding objects to free from memory.

All objects derived from the IDisposable interface, have this method called Dispose(). Dispose() will clean up all resources the object uses. If you're done using an object, call the Dispose() method so the garbage collector can do it's work. In C# the using statement helps you to not forget to call the dispose method. The example below instantiates a new object, but because i'm doing this with the using statement, the object will automatically dispose at the last bracket
<br />
using (ObjectType myObject = new ObjectType())<br />
{<br />
    myObject.DoSomething();<br />
}<br />

This code is by the way the same as :
<br />
ObjectType myObject = new ObjectType();<br />
myObject.DoSomething();<br />
myObject.Dispose();<br />


You also need to find out which of your own classes are suitable to implement the IDisposable interface to they can also dispose themselves.

The garbage collector runs pretty much automaticly and you shouldn't interfere, however if you really feel like freeing memory is useful at a certain point, you can call the garbage collectors Collect() method :
<br />
GC.Collect();<br />


The collect however is pretty time-consuming and neat programmers don't need to use the Collect(). There may be exceptions to that however...

.: I love it when a plan comes together :.
http://www.zonderpunt.nl

GeneralRe: Memory used by my Application increases at each click of a mouse Pin
Ashfaq Maniar2-Aug-08 0:19
Ashfaq Maniar2-Aug-08 0:19 
QuestionSimple .Application question Pin
Dalek Dave29-Jul-08 21:47
professionalDalek Dave29-Jul-08 21:47 
QuestionEncryption & Decryption Pin
SNarayanan29-Jul-08 21:01
SNarayanan29-Jul-08 21:01 
AnswerRe: Encryption & Decryption Pin
Christian Graus29-Jul-08 21:04
protectorChristian Graus29-Jul-08 21:04 
GeneralRe: Encryption & Decryption Pin
Jon_Boy30-Jul-08 1:51
Jon_Boy30-Jul-08 1:51 
AnswerRe: Encryption & Decryption Pin
Ravi Kumar Tyagi29-Jul-08 21:34
Ravi Kumar Tyagi29-Jul-08 21:34 
GeneralRe: Encryption & Decryption Pin
SNarayanan30-Jul-08 22:28
SNarayanan30-Jul-08 22:28 
GeneralRe: Encryption & Decryption Pin
Ravi Kumar Tyagi4-Aug-08 1:20
Ravi Kumar Tyagi4-Aug-08 1:20 
QuestionConnecting Access with VB.Net in Visual Studio 2005 or 2008 Pin
Zaid Pirwani29-Jul-08 18:57
Zaid Pirwani29-Jul-08 18:57 
AnswerRe: Connecting Access with VB.Net in Visual Studio 2005 or 2008 Pin
Christian Graus29-Jul-08 20:10
protectorChristian Graus29-Jul-08 20:10 
QuestionRe: Connecting Access with VB.Net in Visual Studio 2005 or 2008 Pin
Zaid Pirwani30-Jul-08 5:28
Zaid Pirwani30-Jul-08 5:28 
AnswerRe: Connecting Access with VB.Net in Visual Studio 2005 or 2008 Pin
Ravi Kumar Tyagi29-Jul-08 21:38
Ravi Kumar Tyagi29-Jul-08 21:38 
QuestionRe: Connecting Access with VB.Net in Visual Studio 2005 or 2008 [modified] Pin
Zaid Pirwani29-Jul-08 22:36
Zaid Pirwani29-Jul-08 22:36 
AnswerRe: Connecting Access with VB.Net in Visual Studio 2005 or 2008 Pin
Vimalsoft(Pty) Ltd29-Jul-08 22:44
professionalVimalsoft(Pty) Ltd29-Jul-08 22:44 
QuestionRe: Connecting Access with VB.Net in Visual Studio 2005 or 2008 Pin
Zaid Pirwani30-Jul-08 5:26
Zaid Pirwani30-Jul-08 5:26 
AnswerRe: Connecting Access with VB.Net in Visual Studio 2005 or 2008 Pin
Vimalsoft(Pty) Ltd30-Jul-08 19:40
professionalVimalsoft(Pty) Ltd30-Jul-08 19:40 
QuestionProblem in accessing CD Drive in VB/VB.Net 2.0! Pin
priyamtheone29-Jul-08 6:06
priyamtheone29-Jul-08 6:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.