helicopter. I'm new to C #, and I got a big picture with GC removing objects that cannot be reached by my code. The problem is that I work with some large (7-40 MB) objects, itβs good that I donβt need all at once, is this any possible way to delete an object? I tried this:
- create big object X
- use big object X
X = null;
GC.Collect();
GC.WaitForPendingFinalizers(); - create next big object ....`
Does this guarantee that the large object will be deleted after exiting GC.WaitForPendingFinalizers();?
I know that I have to implement my design in order to make objects smoother, but believe me, I tried, and this complicates the logic. If there is no other way, I will do it, the code will be 2 or 3 times larger.
thank!
source
share