{"id":4915,"date":"2014-03-30T16:55:38","date_gmt":"2014-03-30T16:55:38","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/smartassembly-memory-management-collection-of-common-programming-errors\/"},"modified":"2014-03-30T16:55:38","modified_gmt":"2014-03-30T16:55:38","slug":"smartassembly-memory-management-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/smartassembly-memory-management-collection-of-common-programming-errors\/","title":{"rendered":"SmartAssembly memory management-Collection of common programming errors"},"content":{"rendered":"<p>Interesting.<\/p>\n<p>A review from 2007 contains this:<\/p>\n<blockquote>\n<p>{smartassembly} uses several different techniques to bring down the memory usage.<\/p>\n<p>We asked the developers of {smartassembly} for some of the specifics, and they told us that by default the CLR reserves a ton of memory for .NET assemblies &#8211; whether or not they request it. So {smartassembly} intelligently detects when the CPU is idle (or thereabout) and increases or decreases the amount of reserved memory for your assembly according to its requirements &#8211; &#8220;automated&#8221; GC in a sense, except that memory may or may not have ever been in use.<\/p>\n<p>In that same vein, {smartassembly} (with the benefit of literally having access to your source code thanks to the way .NET is designed) marks any and all classes that don&#8217;t have any detectable &#8220;child&#8221; classes inheriting from them as &#8220;sealed&#8221; thereby reducing the amount of memory and CPU used by the CLR during run-time to determine what functions should be made available to other classes and libraries.<\/p>\n<\/blockquote>\n<p>The same review has a &#8220;before\/after&#8221; pair of screenshots showing an application going from 8M to 420K. This suggests to me that it&#8217;s actually just reducing the working set of the application, not the real memory requirements. The same &#8220;optimisation&#8221; appears to occur if you minimise an app. It doesn&#8217;t suddenly take up less memory. I don&#8217;t believe the desktop .NET framework can <em>really<\/em> run with only 420K.<\/p>\n<p>The automatic sealing feature is interesting &#8211; I can&#8217;t see that it helps other than for lookup of virtual methods. I doubt that the impact is really significant, but of course I haven&#8217;t benchmarked it.<\/p>\n<p>So, nothing conclusive, but I doubt that it&#8217;s doing anything that I&#8217;d particularly want.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Interesting. A review from 2007 contains this: {smartassembly} uses several different techniques to bring down the memory usage. We asked the developers of {smartassembly} for some of the specifics, and they told us that by default the CLR reserves a ton of memory for .NET assemblies &#8211; whether or not they request it. So {smartassembly} [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4915","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4915"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4915\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}