title: Best practices to optimize memory in C#
body: <p>What are the best practices to optimize memory in C#. </p>
  
  <p>I am using following technique to optimize my memory.</p>
  
  <ol>
  <li>Dispose an object after use or make it null.</li>
  <li>Use try/finally or using block.</li>
  <li>Use GC.Collect() if required.</li>
  <li>Remove unnecessary object initialization.</li>
  <li>Manage Image caching.</li>
  <li>Mange BLOB data, Memory stream and file stream</li>
  </ol>
  
  <p>Even if there is memory leakage.</p>
  
  <p>My application is using following things:</p>
  
  <ol>
  <li>Processing configuration files, </li>
  <li>Using other XML files. </li>
  <li>Using image functions zoom-in, zoom-out, display different type of images, changing color of images, saving data in xml.</li>
  <li>Saving data in SQL server.</li>
  </ol>