<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to determine size of .NET managed object in memory (like a sizeof for reference types)</title><link>http://blogs.msdn.com/mab/archive/2006/04/24/582666.aspx</link><description>An approximate way to determine the size of object usage in memory can be done by checking the total memory before and after the creation of the object. In the following example it is assumed you have a class named foo. long StopBytes = 0; foo myFoo;</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: How to determine size of object in memory (like a sizeof for reference types)</title><link>http://blogs.msdn.com/mab/archive/2006/04/24/582666.aspx#582754</link><pubDate>Tue, 25 Apr 2006 09:36:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:582754</guid><dc:creator>ernow</dc:creator><description>I like this solution but it isn't very threadsafe...&lt;br&gt;&lt;br&gt;When another thread allocates (or worse causes the release of) memory your calculation might go wrong and give you the impression that the object has a negative size... (now that would be cool if it was true!)&lt;br&gt;&lt;br&gt;Read this to get more info: &lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/cbrumme/archive/2003/04/15/51326.aspx"&gt;http://blogs.msdn.com/cbrumme/archive/2003/04/15/51326.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;Cheers&lt;br&gt;&lt;br&gt;Erno</description></item><item><title>Interesting Finds</title><link>http://blogs.msdn.com/mab/archive/2006/04/24/582666.aspx#582946</link><pubDate>Tue, 25 Apr 2006 14:07:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:582946</guid><dc:creator>Jason Haley</dc:creator><description /></item></channel></rss>