title: C# memory allocation: Difference between static class and a static instance
body: <p>How does CLR allocates memory in these 2 cases: <br>
  Are they both allocated in static memory area?</p>
  
  <pre><code>static class A 
  {
      //Some methods
  }
  </code></pre>
  
  <p><strong>and</strong></p>
  
  <pre><code>class A 
  {
      //Some methods    
  }
  class B
  {
      static A inst = new A();
      //Some methods
  }
  </code></pre>
  
  <p>For the below statement, will the compiler</p>
  
  <pre><code>static A inst = new A();
  </code></pre>
  
  <p>allocate <em>A</em> in heap and assign it to static reference <em>inst</em> reference?
  <strong>Or</strong>
  it will create a static instance in <strong><em>High Frequency heap</em></strong>?</p>