Comments
1 comment
-
Value types like booleans won't show up in the memory profiler unless they have been boxed by .NET, as in all other cases they will be part of other classes and not visible as distinct objects.
A boxed boolean will have 8 bytes of .NET header, 1 byte of boolean and 3 bytes to make the size a multiple of 4 (exactly the same as a class containing a single boolean field). This makes them quite inefficient to store as objects - if you consider the fact that you also need to have at least one reference to this boolean the total memory required is actually 16 bytes per boolean.
Add comment
Please sign in to leave a comment.
So what is causing the extra 11 bytes to show up in Memory Profiler?
Thanks