Skip to content

Add Memory Usage Calculation for eStore Data Structure #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: redesign-expire
Choose a base branch
from

Conversation

sggeorgiev
Copy link

Overview

Introduces comprehensive memory usage tracking for ebuckets and estore data structures to enable better memory profiling and optimization.

Changes

ebMemUsage(): Calculates memory footprint of individual ebuckets instances
estoreMemUsage(): Calculates total memory usage across all buckets in an estore

Key Features

Stack Type: Recursively calculates L1/L2 levels plus L3 vector segments
Rax Type: Accounts for rax structure, nodes, keys, and segment headers
List Type: Returns 0 (items stored inline)
Empty Buckets: Fast-path returns 0
Cluster-aware: Optimized calculation for clustered vs non-clustered modes

Test Coverage

✅ Empty buckets return 0
✅ List-based buckets return 0 (inline storage)
✅ Rax-based buckets with multiple segments
✅ Extended segments with NextSegHdr
✅ Stack-based buckets with L1/L2/L3 levels

Use Cases

Memory profiling and debugging
Resource usage monitoring
Performance optimization analysis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant