title: FixedThreadPool vs CachedThreadPool: the lesser of two evils
body: <p>I have a program that spawns threads (~5-150) which perform a bunch of tasks. Originally, I used a <code>FixedThreadPool</code> because <a href="https://stackoverflow.com/questions/949355/newcachedthreadpool-v-s-newfixedthreadpool">this similar question</a> suggested they were better suited for longer lived tasks and with my very limited knowledge of multithreading, I considered the average life of the threads (several minutes) "<em>long lived</em>".</p>
  
  <p>However, I recently added the capability to spawn additional threads and doing so takes me above the thread limit I set. In this case, would it be better to guess and increase the number threads I can allow or to switch to a <code>CachedThreadPool</code> so I have no wasted threads?</p>
  
  <p>Trying them both out preliminarily, there doesn't <em>seem</em> to be a difference so I'm inclined to go with the <code>CachedThreadPool</code> just to avoid the waste. However, does the life span of the threads mean I should instead picked a <code>FixedThreadPool</code> and just deal with the unused threads? <a href="https://stackoverflow.com/questions/13110313/java-fixedthreadpool-with-known-pool-size-but-unknown-workers">This question</a> makes it seem like those extra threads aren't wasted but I would appreciate the clarification.</p>