1

In .NET/C#, I have a class which consists of only value types. I want to estimate how much memory large sets of objects of this class use. How to get the size of a single instance of this class?

Here's what the class contains:

  • DateTime
  • DateTime?
  • int ( 4 times)
  • int? ( 5 times)
  • Guid

Basically, I am looking for information on how much memory each of these types use (on a 64bit System).

Note: I have seen answers like this one about profiling (which does not actually answer the question there, nor mine) and this question, without restriction to value types, so I do not consider this a duplicate.

Marcel
  • 15,039
  • 20
  • 92
  • 150

0 Answers0