Why do value types show up in the memory profiler?
NickWaanders
Posts: 8
Hi,
I am wondering why some of my value types (structs) are showing up in the ANTS memory profiler?
I was under the impression that the memory profiler only shows objects that are garbage collected, and value types shouldn't be, correct?
Cheers,
Nick
I am wondering why some of my value types (structs) are showing up in the ANTS memory profiler?
I was under the impression that the memory profiler only shows objects that are garbage collected, and value types shouldn't be, correct?
Cheers,
Nick
Comments
I'd say that they've probably been boxed because they've been added to collections, or perhaps they're the values of member fields of classes types, whose instances are going to be on the heap. I think the former is probably more likely.
Now, I've never looked at the memory profiler codebase, so I'm unsure how it deals with arrays of value types, and I've never been looking for them when tracking down a memory problem (I tend to filter out anything I'm not interested in using the column filters), but I seriously doubt the individual values would appear in the results.
Hope that helps.
Thanks,
Bart
Principal Consultant
bartread.com Ltd
Thanks!
Nick