Is there a way to invoke the garbage collector on a specific object within managed memory from an application?
e.g. (in pseudo-code)
Read myString from file;
perform arbitrary operation on myString;
invoke garbage-collector to remove myString
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.
GC.Collect() it’ll tell it to run a collection. But, it won’t collect specific objects. The GC is non-deterministic in relation to which objects are collected or not and when.