Does the .dispose() method do anything at all?

前端 未结 4 1890
鱼传尺愫
鱼传尺愫 2021-02-09 20:32

I was experimenting with ways to get rid of some memory leaks within my application the other day when I realized that I know virtually nothing about cleaning up my resources.

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-09 21:31

    Calling Dispose() will only release unmanaged resources, such as file handles, database connections, unmanaged memory, etc. It will not release garbage collected memory.

    Garbage collected memory will only get released at the next collection. Usually when the application domain memory is deamed full.

提交回复
热议问题