title: Java Executor that adjusts thread pool based on CPU and RAM usage
body: <p>My application uses an Executor to provide a thread pool for a large number of tasks.  I've determined, through both analysis and benchmarking, that my application runs fastest when there are multiple threads per core.  A good heuristic is start with 4 threads per core, varying until you hit >90% CPU or >90% RAM.</p>
  
  <p>Is there an Executor available that will do this out of the box? Either automatically use N threads per core (not just one), or, ideally, throttle the thread pool size based on CPU and RAM usage?</p>
  
  <p>Failing that - How can I determine the number of cores programatically?</p>