title: Ways to make your program use less memory
body: <p>Software will use memory, no big suprise, but how do you keep this usage to a minimum in comparison to how big your program is.</p>
  
  <p>Best example I think would be Firefox. Some users have experienced it, others haven't, but it's pretty safe to say that all the previous versions of Firefox used much more memory then the current version. Yet still, functionality expands and options are added.
  I'd expect the memory usage to go up as extra options and such stuff gets added.</p>
  
  <p>So in other words, there must be methods by which to make sure your program doesn't use up the memory of the computer.</p>
  
  <p>So, I'm turning this into a "best-practices" question, asking all of you what your little tricks and tweaks are to make your program do what it does, with less CPU then you'd normally think. And also, what to most certainly avoid.</p>
  
  <p>A little side-question here: I came accross something in a book about C#.
  Apparently, when coding an Enum, it's possible to set the size of the index of this Enum.
  With large Enum's, you should let the compiler handle it I guess, but for an Enum which only holds like 2 or 3 items, you can do this:</p>
  
  <pre><code>public enum HTMLTYPE : sbyte
  {
      HTML401,XHTML10,XHTML11
  }
  </code></pre>
  
  <p>For those of you who don't know why, apparently the amount of memory reserved for the index of any Enum is automatically set to an integer in C#. So in other words, that amount of memory is going to be reserved. But when defining so little things in your Enum, an integer is a waste of space.
  The book claimed that this could cut down the amount of memory used by the program. I'm wondering if this is true.</p>
  
  <p>EDIT: indeed, it should be memory, darn me. Changed all entries.</p>