title: adobe AIR: prevent GC from running
body: <p>For a game (using AIR for iOS) I want to prevent the GC from running during a specific 30 seconds sequence (because it causes very notable lags).</p>
  
  <p>What I already do is calling System.gc() right before the sequence starts. During the sequence, i don't create many new objects and only some animations play and objects move (in 3D). some of the objects move out of the stage.</p>
  
  <p>the memory statistics during this sequence are aproximately:</p>
  
  <pre><code>System.totalMemory: 4.5 MB
  System.freeMemory: 1.0 MB
  System.privateMemory: 75 MB
  </code></pre>
  
  <p>When the GC fires, the System.privateMemory drops to 74 MB, but causes a lag of aproximately one second. The GC fires twice during this 30 second sequence.</p>
  
  <p>So my question is about any techniques, hacks or workarrounds (other than optimizing the memory usage in general - obviously i'm already working on that) to prevent the GC from firing during this 30 seconds?</p>
  
  <p>thanks.</p>