Click here to Skip to main content
16,004,906 members
Home / Discussions / C#
   

C#

 
AnswerRe: About Interfaces Pin
Ben Fair25-Nov-08 4:27
Ben Fair25-Nov-08 4:27 
QuestionCould the GC collect a static variable? Pin
HosamAly25-Nov-08 3:15
HosamAly25-Nov-08 3:15 
AnswerRe: Could the GC collect a static variable? Pin
N a v a n e e t h25-Nov-08 3:22
N a v a n e e t h25-Nov-08 3:22 
GeneralRe: Could the GC collect a static variable? Pin
HosamAly25-Nov-08 3:23
HosamAly25-Nov-08 3:23 
QuestionRe: Could the GC collect a static variable? Pin
HosamAly25-Nov-08 3:40
HosamAly25-Nov-08 3:40 
AnswerRe: Could the GC collect a static variable? Pin
Simon P Stevens25-Nov-08 4:10
Simon P Stevens25-Nov-08 4:10 
GeneralRe: Could the GC collect a static variable? Pin
HosamAly25-Nov-08 20:15
HosamAly25-Nov-08 20:15 
GeneralRe: Could the GC collect a static variable? Pin
Simon P Stevens25-Nov-08 22:30
Simon P Stevens25-Nov-08 22:30 
Ahh, I see what you are trying to do.

My assumption would be that static variables do not get collected. Even if you don't currently have any references too them, because at any point, you could have a reference by using them for something as they are accessible from everywhere.

But, like I said, if private and it's not used anywhere in the class, I wouldn't be all the surprised if the compiler just removed it.

You're probably going to struggle to get an answer to this. It's quite specific. Possibly try asking on the MSDN forum for the CLR, perhaps someone in MS could give you an answer.

Alternatively, I believe the GCHandle class can be used to track object lifetime, so you could test it out.

Good luck.

Simon

GeneralRe: Could the GC collect a static variable? Pin
HosamAly28-Nov-08 21:56
HosamAly28-Nov-08 21:56 
QuestionWebRequest.RequestUri Pin
Thekaninos25-Nov-08 2:39
Thekaninos25-Nov-08 2:39 
AnswerRe: WebRequest.RequestUri Pin
Ravi Bhavnani25-Nov-08 2:47
professionalRavi Bhavnani25-Nov-08 2:47 
AnswerRe: WebRequest.RequestUri Pin
Giorgi Dalakishvili25-Nov-08 2:48
mentorGiorgi Dalakishvili25-Nov-08 2:48 
AnswerRe: WebRequest.RequestUri Pin
Pr@teek B@h!25-Nov-08 3:21
Pr@teek B@h!25-Nov-08 3:21 
AnswerRe: WebRequest.RequestUri Pin
Thekaninos25-Nov-08 3:30
Thekaninos25-Nov-08 3:30 
Questionhow can i copy a file to somewhere in my hard disk? Pin
maifs25-Nov-08 2:19
maifs25-Nov-08 2:19 
AnswerRe: how can i copy a file to somewhere in my hard disk? Pin
Simon P Stevens25-Nov-08 2:25
Simon P Stevens25-Nov-08 2:25 
JokeRe: how can i copy a file to somewhere in my hard disk? Pin
Giorgi Dalakishvili25-Nov-08 2:32
mentorGiorgi Dalakishvili25-Nov-08 2:32 
GeneralRe: how can i copy a file to somewhere in my hard disk? Pin
Simon P Stevens25-Nov-08 3:09
Simon P Stevens25-Nov-08 3:09 
JokeRe: how can i copy a file to somewhere in my hard disk? Pin
Giorgi Dalakishvili25-Nov-08 3:13
mentorGiorgi Dalakishvili25-Nov-08 3:13 
GeneralRe: how can i copy a file to somewhere in my hard disk? Pin
Guffa25-Nov-08 14:11
Guffa25-Nov-08 14:11 
GeneralRe: how can i copy a file to somewhere in my hard disk? Pin
Giorgi Dalakishvili25-Nov-08 4:53
mentorGiorgi Dalakishvili25-Nov-08 4:53 
GeneralRe: how can i copy a file to somewhere in my hard disk? Pin
Simon P Stevens25-Nov-08 5:09
Simon P Stevens25-Nov-08 5:09 
GeneralRe: how can i copy a file to somewhere in my hard disk? Pin
maifs25-Nov-08 3:00
maifs25-Nov-08 3:00 
AnswerRe: how can i copy a file to somewhere in my hard disk? Pin
Giorgi Dalakishvili25-Nov-08 2:26
mentorGiorgi Dalakishvili25-Nov-08 2:26 
GeneralRe: how can i copy a file to somewhere in my hard disk? Pin
maifs25-Nov-08 3:03
maifs25-Nov-08 3:03 

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.