Use the writemap flag to reduce the memory usage

This commit is contained in:
Kerollmops 2023-05-15 10:15:33 +02:00
parent e01980c6f4
commit c4a40e7110
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
7 changed files with 74 additions and 41 deletions

View file

@ -125,10 +125,15 @@ impl IndexMapper {
index_count: usize,
indexer_config: IndexerConfig,
) -> Result<Self> {
let mut wtxn = env.write_txn()?;
let index_mapping = env.create_database(&mut wtxn, Some(INDEX_MAPPING))?;
let index_stats = env.create_database(&mut wtxn, Some(INDEX_STATS))?;
wtxn.commit()?;
Ok(Self {
index_map: Arc::new(RwLock::new(IndexMap::new(index_count))),
index_mapping: env.create_database(Some(INDEX_MAPPING))?,
index_stats: env.create_database(Some(INDEX_STATS))?,
index_mapping,
index_stats,
base_path,
index_base_map_size,
index_growth_amount,