Click here to Skip to main content
15,925,602 members
Home / Discussions / C#
   

C#

 
AnswerRe: Design Pattern Pin
Nick Parker11-Apr-06 4:58
protectorNick Parker11-Apr-06 4:58 
QuestionChanging refresh rate Pin
Da_Masca11-Apr-06 4:00
Da_Masca11-Apr-06 4:00 
QuestionGUI as Visual-Studio-IDE Pin
Tomerland11-Apr-06 3:29
Tomerland11-Apr-06 3:29 
AnswerRe: GUI as Visual-Studio-IDE Pin
-Dy11-Apr-06 4:05
-Dy11-Apr-06 4:05 
GeneralRe: GUI as Visual-Studio-IDE Pin
Tomerland11-Apr-06 9:50
Tomerland11-Apr-06 9:50 
AnswerRe: GUI as Visual-Studio-IDE Pin
Luis Alonso Ramos11-Apr-06 7:36
Luis Alonso Ramos11-Apr-06 7:36 
QuestionDispose method Help needed Pin
agmb11-Apr-06 3:20
agmb11-Apr-06 3:20 
AnswerRe: Dispose method Help needed Pin
Guffa11-Apr-06 4:01
Guffa11-Apr-06 4:01 
Include both a Dispose method and a destructor, to make sure that the object is always disposed of:

public void Dispose() {
	if (this.myData != null) {
		this.myData.Dispose();
		this.myData = null;
	}
	GC.SuppressFinalize(this);
}
~MyClass() {
	this.Dispose();
}


The task manager is not suitable for monitoring memory usage for .NET applications. The size reported also includes the unused heap space. You shouldn't get a MemoeryOut exception, though, that indicates that there is some problem.

You only have to dispose of classes that have a Dispose method. Strings are fully managed and doesn't need to be disposed. Integers are value types, so they are not allocated in the heap at all.

The garbage collector manages all the removal of unused objects, and you normally don't need to bother how it does that. Garbage collections are performed when needed, and when it's appropriate. If you run into memory problems, it's rarely the fault of the garbage collector, but more likely a memory leak in the code you are using.


---
b { font-weight: normal; }

GeneralRe: Dispose method Help needed Pin
agmb11-Apr-06 6:06
agmb11-Apr-06 6:06 
AnswerRe: Dispose method Help needed Pin
Guffa11-Apr-06 7:11
Guffa11-Apr-06 7:11 
QuestionHow to do this? Pin
eric_tran11-Apr-06 2:37
eric_tran11-Apr-06 2:37 
AnswerRe: How to do this? Pin
thomasa11-Apr-06 3:06
thomasa11-Apr-06 3:06 
GeneralRe: How to do this? Pin
eric_tran11-Apr-06 3:19
eric_tran11-Apr-06 3:19 
GeneralRe: How to do this? Pin
J4amieC11-Apr-06 3:47
J4amieC11-Apr-06 3:47 
GeneralRe: How to do this? Pin
eric_tran12-Apr-06 1:23
eric_tran12-Apr-06 1:23 
GeneralRe: How to do this? Pin
thomasa11-Apr-06 4:17
thomasa11-Apr-06 4:17 
AnswerRe: How to do this? Pin
Guffa11-Apr-06 7:34
Guffa11-Apr-06 7:34 
GeneralRe: How to do this? Pin
eric_tran12-Apr-06 1:36
eric_tran12-Apr-06 1:36 
QuestionMaking an app not function after some time Pin
naglbitur11-Apr-06 2:34
naglbitur11-Apr-06 2:34 
AnswerRe: Making an app not function after some time Pin
Timothy_198211-Apr-06 2:58
Timothy_198211-Apr-06 2:58 
AnswerRe: Making an app not function after some time Pin
thomasa11-Apr-06 3:04
thomasa11-Apr-06 3:04 
GeneralRe: Making an app not function after some time Pin
naglbitur11-Apr-06 3:57
naglbitur11-Apr-06 3:57 
GeneralRe: Making an app not function after some time Pin
naglbitur11-Apr-06 4:02
naglbitur11-Apr-06 4:02 
GeneralRe: Making an app not function after some time Pin
Gavin Roberts11-Apr-06 6:08
Gavin Roberts11-Apr-06 6:08 
AnswerRe: Making an app not function after some time Pin
Luis Alonso Ramos11-Apr-06 7:43
Luis Alonso Ramos11-Apr-06 7:43 

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.