From 9390be1212873fc045cb47605c53df188e982437 Mon Sep 17 00:00:00 2001 From: Frederik Rothenberger Date: Mon, 15 Apr 2024 09:15:05 +0200 Subject: [PATCH] Increase archive buffer memory limit (#2428) This PR increases the memory limit for the archive buffer. --- src/internet_identity/src/storage.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/internet_identity/src/storage.rs b/src/internet_identity/src/storage.rs index 6f2429dfea..f9a940d1fa 100644 --- a/src/internet_identity/src/storage.rs +++ b/src/internet_identity/src/storage.rs @@ -231,7 +231,11 @@ impl Storage { // A single archive entry takes on average 476 bytes of space. // To have space for 10_000 entries (accounting for ~10% overhead) we need 82 pages or ~5 MB. // Since the memory manager allocates memory in buckets of 128 pages, we use a full bucket here. - let archive_buffer_memory = single_bucket_memory(&memory_manager, ARCHIVE_BUFFER_MEMORY_ID); + // XX: Clean-up after incident + let archive_buffer_memory = RestrictedMemory::new( + memory_manager.get(ARCHIVE_BUFFER_MEMORY_ID), + 0..(10 * BUCKET_SIZE_IN_PAGES as u64), + ); let persistent_state_memory = memory_manager.get(PERSISTENT_STATE_MEMORY_ID); Self { header, @@ -494,17 +498,6 @@ impl Storage { } } -/// Creates a new virtual memory corresponding to the given ID that is limited to a single bucket. -fn single_bucket_memory( - memory_manager: &MemoryManager>, - memory_id: MemoryId, -) -> NestedRestrictedMemory { - RestrictedMemory::new( - memory_manager.get(memory_id), - 0..BUCKET_SIZE_IN_PAGES as u64, - ) -} - #[derive(Debug)] pub enum StorageError { AnchorNumberOutOfRange {