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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -