.net - How to clear a memory early in c# -


after finishing use varible, can clear memory before gc it?

if there specific resources need released immediately, implement idisposable interface , call dispose() (sometimes close() on objects, such streams).

if looking prevent passwords being retained in memory beyond lifespan, securestring supports this, though not simple use.

otherwise, have no control on when garbage collector runs or does. if desperately need kind of control, need lower level language.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

binding - How can you make the color of elements of a WPF DrawingImage dynamic? -

c# - How to add a new treeview at the selected node? -