Add restate-memory crate with EstimatedMemorySize trait#4336
Merged
AhmedSoliman merged 1 commit intomainfrom Feb 6, 2026
Merged
Add restate-memory crate with EstimatedMemorySize trait#4336AhmedSoliman merged 1 commit intomainfrom
AhmedSoliman merged 1 commit intomainfrom
Conversation
Test Results 7 files + 2 7 suites +2 2m 46s ⏱️ + 1m 44s Results for commit 2f52afe. ± Comparison against base commit 3690b87. This pull request removes 26 and adds 47 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
tillrohrmann
approved these changes
Feb 6, 2026
Contributor
tillrohrmann
left a comment
There was a problem hiding this comment.
This is a great building block for making our memory consumption more predictable @AhmedSoliman. LGTM. +1 for merging :-)
68c45b4 to
2f52afe
Compare
Introduce a new restate-memory crate containing memory management utilities. The crate provides EstimatedMemorySize trait for types that can be significant contributors to memory usage. Key features: - EstimatedMemorySize trait with blanket impls for references (&T, &mut T) - Impls for common types: String, Bytes, BytesMut, [u8], str, Vec<T>, [T] - Impls for smart pointers: Arc<T>, Rc<T>, Box<T>, Cow<T> - Impls for lock guards: MutexGuard, RwLockReadGuard, RwLockWriteGuard, Ref, RefMut - Impl for Option<T> The trait is re-exported through restate-types::memory for convenience. Also implements EstimatedMemorySize for Record, Payloads, Store, and PolyBytes in restate-types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce a new restate-memory crate containing memory management utilities.
The crate provides EstimatedMemorySize trait for types that can be significant
contributors to memory usage.
Key features:
The trait is re-exported through restate-types::memory for convenience.
Also implements EstimatedMemorySize for Record, Payloads, Store, and PolyBytes
in restate-types.
Stack created with Sapling. Best reviewed with ReviewStack.