title: why no sawtooth shape in memory usage statistics?
body: <p>Recently I made such experiment - new objects constantly spawned in a non-stop loop without saving any references of them, so they should get destroyed by garbage collector at nearest suitable moment. The only special thing is that objects are very big in terms of memory usage - one object holds array of 70 million elements. This is the code :</p>
  
  <pre><code>class Temp {
      private $data;
  
      function __construct() {
          $this-&gt;data = range(1,70000000);
      }
  }
  
  while (true) {
      new Temp();
  }
  </code></pre>
  
  <p>I was very surprised that there is no any sawtooth typical behavior of garbage collector in memory usage graph. Here it is (70 million elements in array) :</p>
  
  <p><a href="https://i.stack.imgur.com/TGjxT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TGjxT.png" alt="enter image description here"></a></p>
  
  <p><strong>Question is - Where is <a href="https://www.ibm.com/developerworks/community/blogs/kevgrig/entry/The_Generational_Garbage_Collector_Sawtooth" rel="nofollow noreferrer">sawtooth</a> ?</strong> </p>
  
  <p>My best guess is that allocation and collection processes of objects starts to work concurrently or something else is going here.</p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>When element count in array is decreased until 60 million - I get
  sawtooth GC behavior as expected (60 million elements in array) :
  <a href="https://i.stack.imgur.com/D00Yp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D00Yp.png" alt="enter image description here"></a></p>
  
  <p><strong>EDIT 2:</strong></p>
  
  <p>In case if number of elements in array is <em>increased</em> (90 million elements in array) - I get a reversed sawtooth graph ! :
  <a href="https://i.stack.imgur.com/ZPEXa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZPEXa.png" alt="enter image description here"></a> </p>
  
  <p>So seems that 70 million elements test is an edge-case between those two different shapes of sawtooth. But the reasons behind that are unclear to me.</p>