title: Best practice for creating millions of small temporary objects
body: <p>What are the "best practices" for creating (and releasing) millions of small objects?</p>
  
  <p>I am writing a chess program in Java and the search algorithm generates a single "Move" object for each possible move, and a nominal search can easily generate over a million move objects per second. The JVM GC has been able to handle the load on my development system, but I'm interested in exploring alternative approaches that would:</p>
  
  <ol>
  <li>Minimize the overhead of garbage collection, and </li>
  <li>reduce the peak memory footprint for lower-end systems.  </li>
  </ol>
  
  <p>A vast majority of the objects are very short-lived, but about 1% of the moves generated are persisted and returned as the persisted value, so any pooling or caching technique would have to provide the ability to exclude specific objects from being re-used. </p>
  
  <p>I don't expect fully-fleshed out example code, but I would appreciate suggestions for further reading/research, or open source examples of a similar nature.</p>