storage of static instance variables
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/6569557/what-is-the-actual-memory-place-for-static-variables">What is the actual memory place for static variables?</a>  </p>
</blockquote>



<p>Where does static instance variables defined in a class are stored - in heap or in Permanent generation?</p>

<p>JLS(both pre java SE 7 and Java SE 7) says that:</p>

<pre><code>17.4.1   Shared Variables
Memory that can be shared between threads is called shared memory or heap
memory.
All instance fields, static fields and array elements are stored in heap memory.
</code></pre>

<p>BUT <a href="http://openjdk.java.net/jeps/122" rel="nofollow">this</a> post says that:</p>

<pre><code>Success Metrics
...
Class metadata, interned Strings and class static variables will be moved from the permanent generation to either the Java heap or native memory.
...

Description
...
Class metadata and statics are allocated in the permanent generation when a class is loaded and are garbage collected from the permanent generation when the class is unloaded. Interned Strings are also garbage collected when the permanent generation is GC’ed.
...
</code></pre>

<p>According to above post statics are in Permanent generation area.</p>

<p>Which is correct??</p>
