title: What's interval to validate the idle object in Apache Commons Pool 2
body: <p>I am using <code>Apache Commons Pool 2</code>, I have set the configuration <code>testWhileIdle</code> to true, which means that the Pool framework will check whether the idle objects they are valid.</p>
  
  <p>I would ask whether this check occurs periodically, if so, what's the default interval, and how i can change it.</p>
  
  <p>I ask so because the objects in the pool should periodically connect to the server to keep alive, and I think pool's <code>validateObject</code> method is a good place to fulfill this.</p>
  
  <p>Per @user7294900's comments,there are two configuration parameters:</p>
  
  <ol>
  <li><code>timeBetweenEvictionRunsMillis</code>, default value is -1</li>
  <li><code>minEvictableIdleTimeMillis</code>, default value is 1800*60*30</li>
  </ol>
  
  <p>I have following two question:</p>
  
  <ol>
  <li>What's the difference between these two parameters?</li>
  <li>I set both of them to 5000, and I have 8 objects in the pool, I print the object's hashcode in my PooledObjectFactory's <code>validateObject</code> method, I found that only 3 objects'hash code has been printed out, then there is no more messages printed again, looks the <code>validateObject</code> 's is not called every 5 seconds or the call to <code>validateObject</code> is stuck?</li>
  </ol>
  
  <p><strong><em>I figured out the problem, please see the comments</em></strong></p>