When do strings and static fields get reclaimed by the garbage collector?
I’m asking this because I know statics in ASP.NET are always live.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Strings are objects and will be collected when un-referenced.
static fields usually keep a permanent reference to an object and thus keep those objects from being collected. But as long as you still need those objects that’s quite alright.