diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2012-09-26 14:57:31 +1000 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2012-09-26 14:57:31 +1000 |
commit | 30cee0a04e383c85d01547ca894b7805fa9f68fa (patch) | |
tree | dfb2a63c25cc2fbdb936961c4c2ffc1b2833f56c /src/include/cache.i | |
parent | 5eba9718d867f42f148b740d061feeffd5a5e4f9 (diff) | |
download | mongo-30cee0a04e383c85d01547ca894b7805fa9f68fa.tar.gz |
Update btree file count to only include open writable files.
Diffstat (limited to 'src/include/cache.i')
-rw-r--r-- | src/include/cache.i | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/include/cache.i b/src/include/cache.i index 2813a055414..ac4d46e00fa 100644 --- a/src/include/cache.i +++ b/src/include/cache.i @@ -57,9 +57,13 @@ __wt_eviction_page_check(WT_SESSION_IMPL *session, WT_PAGE *page) F_ISSET(session->btree, WT_BTREE_NO_EVICTION)) return (0); - /* Check the page's memory footprint. */ + /* + * Check the page's memory footprint - evict pages that take up more + * than their fair share of the cache. We define a fair share as + * approximately half the cache size per open writable btree handle. + */ if ((int64_t)page->memory_footprint > - conn->cache_size / (2 * (conn->btqcnt + 1))) + conn->cache_size / (2 * (conn->open_btree_count + 1))) return (1); /* |