Find out how much memory is being used by an object in C#?

前端 未结 3 1618
予麋鹿
予麋鹿 2020-12-30 05:37

Does anyone know of a way to find out how much memory an instance of an object is taking?

For example, if I have an instance of the following object:



        
3条回答
  •  清歌不尽
    2020-12-30 06:20

    I have good experiences with MemProfiler. It gives you stack traces of when the object was created and all the graphs of why the object is still not garbage collected.

提交回复
热议问题