c# - Is this an efficient way to measure the memory size of an object? -
I am making a game and I would like to measure how much memory will be captured by a concept. I think it will not be 100% accurate, but does it give me a reliable ballpark shape on the size of the object?
using the system; Using System.Collections.Generic; Namespace sandbox {public class program {public static zero main (string [] arg) {long time start sky = GC.GetTotalMemory (true); Dictionary & lt; Summary, KeyWalphere & lt; short, short & gt; & Gt; Price = New Dictionary & lt; short, keypad & lt; short, short & gt; & Gt; (); (Small i = 0; i , then not really, because
GC strokes will not be counted, those who sit on the stack memory and do not have a heap. It's probably more accurate how much you know it. You have access to each item of memory.
Comments
Post a Comment