I was wondering if there is a way to find the size of the reference type in C #. I did a few googling, and the general idea on the forums seems like this is impossible. I thought I would ask you guys and see if anyone here knows better.
After all, should profiling tools have a way to do this? I know that it is usually not necessary to know this information, but it would be useful to have in some situations.
Check this detailed answer from Jon, you will find useful information.
, profilig. JIT , , , ( 32 64 ), (MS, Mono, GNU.NET ..), .
:
32bit 64bit
( VTable ..), , ( ), , ( , , ).
, , , (, , , , .. )?
Hmmm. I would use a profiling tool, but I think something like this might work:
long before = System.GC.GetTotalMemory(true); Foo instance = new Foo(); long after = System.GC.GetTotalMemory(true); long consumed = after - before;
Source: https://habr.com/ru/post/1708328/More articles:Liferay-ui: icon localization - portletHow to remove a fragment in Visual Studio C # Express? - c #IE8 зависает, когда одновременно запускается более 4 асинхронных XmlHttpRequests - internet-explorerHow to ensure that the JVM starts with an Xms value - javaFile System Testing Tools - linuxSubmitting AjaxForm using jQuery in ASP.NET MVC - jqueryIs there a way to prevent dll from opening in software such as a reflector? - c #Report generation in PHP (pdf, xls, doc, csv format required) - php.NET Application and ASP.NET Domains - .netWhy in this example does using float make me go 2x slower than with doubles? - c ++All Articles