Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2311,8 +2311,10 @@ impl AccountsDb {
accounts_hash_cache_path: Option<PathBuf>,
) -> Self {
let num_threads = get_thread_count();
// 400M bytes
const MAX_READ_ONLY_CACHE_DATA_SIZE: usize = 400_000_000;
// The high and low watermark sizes for the accounts read cache. If the cache size exceeds
// MAX_SIZE_HI, it'll evict entries until the size is <= MAX_SIZE_LO.
const MAX_READ_ONLY_CACHE_DATA_SIZE_LO: usize = 400_000_000;
const MAX_READ_ONLY_CACHE_DATA_SIZE_HI: usize = 400_000_000;
// read only cache does not update lru on read of an entry unless it has been at least this many ms since the last lru update
const READ_ONLY_CACHE_MS_TO_SKIP_LRU_UPDATE: u32 = 100;

Expand Down Expand Up @@ -2352,7 +2354,8 @@ impl AccountsDb {
accounts_cache: AccountsCache::default(),
sender_bg_hasher: None,
read_only_accounts_cache: ReadOnlyAccountsCache::new(
MAX_READ_ONLY_CACHE_DATA_SIZE,
MAX_READ_ONLY_CACHE_DATA_SIZE_LO,
MAX_READ_ONLY_CACHE_DATA_SIZE_HI,
READ_ONLY_CACHE_MS_TO_SKIP_LRU_UPDATE,
),
uncleaned_pubkeys: DashMap::new(),
Expand Down
Loading