/* Calculate size of hash table (maximum currently 64k buckets). */
/* this is very bogus, its specific to the any Store maintaining an
* in-core index, not global */
- size_t buckets = Store::Root().maxSize() / Config.Store.avgObjectSize;
+ size_t buckets = (Store::Root().maxSize() + ( Config.memMaxSize >> 10)) / Config.Store.avgObjectSize;
debugs(20, 1, "Swap maxSize " << Store::Root().maxSize() <<
- " KB, estimated " << buckets << " objects");
+ " + " << ( Config.memMaxSize >> 10) << " KB, estimated " << buckets << " objects");
buckets /= Config.Store.objectsPerBucket;
debugs(20, 1, "Target number of buckets: " << buckets);
/* ideally the full scan period should be configurable, for the
store_table = hash_create(storeKeyHashCmp,
store_hash_buckets, storeKeyHashHash);
- for (int i = 0; i < Config.cacheSwap.n_configured; i++)
+ for (int i = 0; i < Config.cacheSwap.n_configured; i++) {
/* this starts a search of the store dirs, loading their
* index. under the new Store api this should be
* driven by the StoreHashIndex, not by each store.
* Step 3: have the hash index walk the searches itself.
*/
store(i)->init();
-
+ }
}
size_t