Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.
Merged
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
10 changes: 8 additions & 2 deletions runtime/src/accounts_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub const ACCOUNTS_INDEX_CONFIG_FOR_TESTING: AccountsIndexConfig = AccountsIndex
bins: Some(BINS_FOR_TESTING),
flush_threads: Some(FLUSH_THREADS_TESTING),
drives: None,
index_limit_mb: Some(1),
index_limit_mb: None,
ages_to_stay_in_cache: None,
scan_results_limit_bytes: None,
};
Expand Down Expand Up @@ -840,7 +840,13 @@ pub struct AccountsIndex<T: IndexValue> {

impl<T: IndexValue> AccountsIndex<T> {
pub fn default_for_tests() -> Self {
Self::new(Some(ACCOUNTS_INDEX_CONFIG_FOR_TESTING))
let mut config = ACCOUNTS_INDEX_CONFIG_FOR_TESTING;
if let Ok(limit) = std::env::var("SOLANA_TEST_ACCOUNTS_INDEX_MEMORY_LIMIT_MB") {
// allocate with disk buckets
config.index_limit_mb = Some(limit.parse::<usize>().unwrap());
}

Self::new(Some(config))
}

pub fn new(config: Option<AccountsIndexConfig>) -> Self {
Expand Down