*/
@Override
public void checkCaches()
{
final int minSize = (int)( totalPageCount * MIN_SHRINK_FACTOR );
Cache cache;
int load;
if( shrinkThreshold >= 0 ) {
for( int i = 0; i < caches.size(); i++ ) {
cache = (Cache)caches.get( i );
if( cache.getGrowthFactor() > 1.0 ) {
load = cache.getLoad();
if( ( cache.getBuffers() > minSize ) && ( load < shrinkThreshold ) ) {
if( LOG.isDebugEnabled() ) {
final NumberFormat nf = NumberFormat.getNumberInstance();
LOG.debug( "Shrinking cache: " + cache.getFileName() + " (a " + cache.getClass().getName() + ") to " + nf.format( cache.getBuffers() ) );
}
currentPageCount -= cache.getBuffers();
cache.resize( getDefaultInitialSize() );
currentPageCount += getDefaultInitialSize();
}
}
}
}