title: Why GC happens even there is lots of unused memory left
body: <p><a href="https://i.stack.imgur.com/Ugmkp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ugmkp.png" alt="enter image description here"></a>
  (Committed and Max lines are the same)</p>
  
  <p>I am looking at the memory usage for a Java application in newrelic. Here are several questions:</p>
  
  <p><strong># 1</strong></p>
  
  <p>The <code>committed PS Survivor Space Heap</code> varied in past few days. But should it be a constant since it is configured by JVM?</p>
  
  <p><strong># 2</strong></p>
  
  <p>From what I am understanding, the heap memory should decrease when there is a garbage collection. The memory of <code>Eden</code> could decrease when a major gc or a minor gc happens, while the memory of <code>Old</code> could decrease when a major gc happens.</p>
  
  <p>But if you look at <code>Old</code> memory usage, some time between June 6th and 7th, the memory went up and then later it went down. This should represent that a major gc happend, right? However, there was still lots of unused memory left. It didn't seem it almost reach the limit. Then how did the major gc be triggered? Same for <code>Eden</code> memory usage, it never reached the limit but it still decreased.</p>
  
  <p>The application fetches a file from other places. This file could be large and be processed in memory. Could this explain the issue above?</p>