.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
Post a Comment