title: Java RAM increases although Heap stays same?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9145769/limit-jvm-process-memory-on-ubuntu">Limit jvm process memory on ubuntu</a>  </p>
  </blockquote>
  
  
  
  <p>In my application I'm uploading documents to a server, which does some analyzing on it. </p>
  
  <p>Today I analyzed my application using jconsole.exe and heap dumps as I tried to find out if I'm having memory issues / a memory leak. I thought I might suffer of one since my application is growing very much on RAM while the application is running. </p>
  
  <p>As I watched the heap / codecache / perm gen etc. memory with jconsole after some runs, I was surprised as I saw the following: </p>
  
  <p><img src="https://www7.pic-upload.de/13.06.12/murk9qrka8al.png" alt="check"></p>
  
  <p>picture link: <a href="https://www7.pic-upload.de/13.06.12/murk9qrka8al.png" rel="nofollow noreferrer">https://www7.pic-upload.de/13.06.12/murk9qrka8al.png</a></p>
  
  <p>As you can see at the jconsole on the right, the heap is increasing when I'm doing analyzing-related stuff, but it's also decreasing again to its normal size when the work is over. On the left you can see the "htop" of the sever the application is deployed on. And there it is: The RAM is, although the heap acts normally and it also seems the garbage collector is running correct, <strong>incredible</strong> high at almost 3,2gb. </p>
  
  <p>This is now really confusing me. I was thinking if my java vm stack could have to do something with this? I did some research and what I found spoke about the vm stack as a little memory with only a few megabytes (or even only kb). </p>
  
  <p><strong>My technical background:</strong> </p>
  
  <ul>
  <li>The application is running on glassfish v.3.1.2</li>
  <li>The database is running on MySQL</li>
  <li>Hibernate is used as ORM framework</li>
  <li>Java version is 1.7.0_04 </li>
  <li>It's implemented using VAADIN</li>
  <li>MySQL database and glassfish are the only things running on this server</li>
  <li>I'm constructing XML-DOM-style documents using JAXB during the analysis and save them in the database</li>
  <li>Uploaded documents are either .txt or .pdf files</li>
  <li>OS is linux</li>
  </ul>
  
  <p><strong>Solution?</strong></p>
  
  <p><strong>Do you have any ideas why this happens and what I can do for fixing it?</strong> I'm really surprised at the moment, since I thought the memory problems came from a memory leak which causes the heap to explode. But now, the heap isn't the problem. It's the RAM that goes higher and higher while the heap stays on the same level. And I don't know what to do to resolve it. </p>
  
  <p><strong>Thanks for every thought you're sharing with me.</strong> </p>
  
  <p>Edit: Maybe I should also state out that this behaviour is currently making me impossible to really let other people use my application. When the RAM is full and the server doesn't respond anymore I'm out.</p>
  
  <p><strong>Edit2: Maybe I should also add that this RAM keeps increasing after every successfull further analyzation.</strong> </p>