Click here to Skip to main content
15,892,809 members
Home / Discussions / C#
   

C#

 
GeneralRe: GC Pin
devin1239-Jun-05 13:19
devin1239-Jun-05 13:19 
GeneralRe: GC Pin
Dave Kreskowiak9-Jun-05 14:46
mveDave Kreskowiak9-Jun-05 14:46 
GeneralRe: GC Pin
PaleyX10-Jun-05 14:43
PaleyX10-Jun-05 14:43 
GeneralRe: GC Pin
PaleyX10-Jun-05 14:48
PaleyX10-Jun-05 14:48 
GeneralNULL Pin
devin1239-Jun-05 12:28
devin1239-Jun-05 12:28 
GeneralRe: NULL Pin
Christian Graus9-Jun-05 12:32
protectorChristian Graus9-Jun-05 12:32 
GeneralRe: NULL Pin
devin1239-Jun-05 12:40
devin1239-Jun-05 12:40 
GeneralRe: NULL Pin
Christian Graus9-Jun-05 12:44
protectorChristian Graus9-Jun-05 12:44 
devin123 wrote:
But I am helping the GC telling the object has no reference, instead of GC finding itself. Is I am not gaining the performance?

You're telling C# that this reference to the object is no longer required. At some point, sometime before your PC totally falls over from lack of memory, the GC will work out that no references are held, and so do garbage collection. I found out the hard way that managed DirectShow leaks memory ( I was loading video files ), and my app was running at a crawl as my memory was full and my disk drive was swapping non stop. GC had not occured.

And why would you gain performance from getting back some memory, unless you have severe memory issues already ?

devin123 wrote:
So I can set a large object to null to achieve performance gain

No, you can Dispose of it to free the memory, and then set it to null. The setting to null is actually irrelevant to performance or memory usage, it's just good coding. This will help if you're in a situation like my example above. You should do this when you have large memory objects flying around, but it will only help performance if excess memory usage is hurting it.


Christian Graus - Microsoft MVP - C++
GeneralRe: NULL Pin
devin1239-Jun-05 12:52
devin1239-Jun-05 12:52 
GeneralRe: NULL Pin
Christian Graus9-Jun-05 12:58
protectorChristian Graus9-Jun-05 12:58 
GeneralRe: NULL Pin
devin1239-Jun-05 13:17
devin1239-Jun-05 13:17 
GeneralRe: NULL Pin
Christian Graus9-Jun-05 13:20
protectorChristian Graus9-Jun-05 13:20 
GeneralRe: NULL Pin
devin1239-Jun-05 13:32
devin1239-Jun-05 13:32 
GeneralRe: NULL Pin
Christian Graus9-Jun-05 13:52
protectorChristian Graus9-Jun-05 13:52 
GeneralRe: NULL Pin
devin1239-Jun-05 13:54
devin1239-Jun-05 13:54 
GeneralRe: NULL Pin
Skynyrd10-Jun-05 0:18
Skynyrd10-Jun-05 0:18 
GeneralRe: NULL Pin
Roger Alsing10-Jun-05 3:09
Roger Alsing10-Jun-05 3:09 
GeneralConvert C++ #define directives to C# Pin
bynaryum9-Jun-05 11:09
bynaryum9-Jun-05 11:09 
GeneralRe: Convert C++ #define directives to C# Pin
Colin Angus Mackay9-Jun-05 12:10
Colin Angus Mackay9-Jun-05 12:10 
GeneralRe: Convert C++ #define directives to C# Pin
DavidNohejl9-Jun-05 14:45
DavidNohejl9-Jun-05 14:45 
QuestionHow to format highlighted text in textbox? Pin
Julianne_juju9-Jun-05 10:30
Julianne_juju9-Jun-05 10:30 
AnswerRe: How to format highlighted text in textbox? Pin
MoustafaS9-Jun-05 14:21
MoustafaS9-Jun-05 14:21 
GeneralRe: How to format highlighted text in textbox? Pin
Pyro Joe9-Jun-05 17:19
Pyro Joe9-Jun-05 17:19 
GeneralRe: How to format highlighted text in textbox? Pin
Julianne_juju10-Jun-05 12:33
Julianne_juju10-Jun-05 12:33 
GeneralA string thing i cannot figure out Pin
sameerhanda9-Jun-05 10:11
sameerhanda9-Jun-05 10:11 

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.