title: Retrieving Total amount of RAM on a computer
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/105031/c-sharp-how-do-you-get-total-amount-of-ram-the-computer-has">C# - How do you get total amount of RAM the computer has?</a>  </p>
  </blockquote>
  
  
  
  <p>The following would retrieve how much ram is available:</p>
  
  <pre><code>PerformanceCounter ramCounter;
  ramCounter = new PerformanceCounter("Memory", "Available MBytes");
  Console.WriteLine("Total RAM: " + ramCounter.NextValue().ToString() + " MB\n\n");
  </code></pre>
  
  <p>Of course we will have to use the System.Diagnostics; class.</p>
  
  <p>Does performancecounter have any functionality for retrieving the amount of RAM of a particular machine? I'm not talking about the amount of ram used or unused. I'm talking about the amount of ram the machine has.</p>