c# - .NET Memory size -
i have pretty basic question storing data , memory footprint.
i have list<t>
stores base objects need. type t has int id define it, along other fields.
i have dictionary. if create dictionary<t, int>
, t object value, memory allocation higher if create dictionary<int, int>
, ie copy of t object stored, or refence t stored again?
thanks
that depends on t
is. if t
reference type (that is, class
), reference stored in dictionary. if t
value type (a struct
), copy stored.
Comments
Post a Comment