add --accounts-index-memory-limit-mb (#19269)

This commit is contained in:
Jeff Washington (jwash)
2021-09-19 18:00:15 -05:00
committed by GitHub
parent ea34eb8a4b
commit c1d181add5
4 changed files with 32 additions and 1 deletions

View File

@ -1990,6 +1990,14 @@ pub fn main() {
.help("Enables faster starting of validators by skipping shrink. \
This option is for use during testing."),
)
.arg(
Arg::with_name("accounts_index_memory_limit_mb")
.long("accounts-index-memory-limit-mb")
.value_name("MEGABYTES")
.validator(is_parsable::<usize>)
.takes_value(true)
.help("How much memory the accounts index can consume. If this is exceeded, some account index entries will be stored on disk. If missing, the entire index is stored in memory."),
)
.arg(
Arg::with_name("accounts_index_bins")
.long("accounts-index-bins")
@ -2512,6 +2520,10 @@ pub fn main() {
accounts_index_config.bins = Some(bins);
}
if let Some(limit) = value_t!(matches, "accounts_index_memory_limit_mb", usize).ok() {
accounts_index_config.index_limit_mb = Some(limit);
}
{
let mut accounts_index_paths = vec![]; // will be option soon
if accounts_index_paths.is_empty() {