Find out how much memory is being used by an object in C#?
问题 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: TestClass tc = new TestClass(); Is there a way to find out how much memory the instance tc is taking? The reason for asking, is that although C# has built in memory management, I often run into issues with not clearing an instance of an object (e.g. a List that keeps track of something). There are couple of reasonably good memory profilers (e.g.