title: JVM and Memory Usage - JRun server not using full PSPermGen allocation?
body: <p>I'm trying to understand why out ColdFusion 9 (JRun) server is throwing the following error: </p>
  
  <pre><code>java.lang.OutOfMemoryError: requested 32756 bytes for ChunkPool::allocate. Out of swap space?
  </code></pre>
  
  <p>The JVM arguments are as follows: </p>
  
  <pre><code>-server -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -
  </code></pre>
  
  <p>I had jconsole running when the dump happened and I am trying to reconcile some numbers with the <code>-XX:MaxPermSize=192m</code> setting above. When JRun died it had the following memory usage:</p>
  
  <pre><code>Heap
   PSYoungGen      total 136960K, used 60012K [0x5f180000, 0x67e30000, 0x68d00000)
    eden space 130624K, 45% used [0x5f180000,0x62c1b178,0x67110000)
    from space 6336K, 0% used [0x67800000,0x67800000,0x67e30000)
    to   space 6720K, 0% used [0x67110000,0x67110000,0x677a0000)
   PSOldGen        total 405696K, used 241824K [0x11500000, 0x2a130000, 0x5f180000)
    object space 405696K, 59% used [0x11500000,0x20128360,0x2a130000)
   PSPermGen       total 77440K, used 77070K [0x05500000, 0x0a0a0000, 0x11500000)
    object space 77440K, 99% used [0x05500000,0x0a043af0,0x0a0a0000)
  </code></pre>
  
  <p>My first question is that the dump shows the <code>PSPermGen</code> being the problem - it says the total is 77440K, but it should be 196608K (based on my 192m JVM argument), right? What am I missing here? Is this something to do with the other non-heap pool - the Code Cache? </p>
  
  <p>I'm running on a 32bit machine, Windows Server 2008 Standard. I was thinking of increasing the <code>PSPermGen</code> JVM argument, but I want to understand why it doesn't seem to be using its current allocation.</p>
  
  <p>Thanks in advance!</p>