Skip to main content

Module memory_guard

Module memory_guard 

Source
Expand description

Memory management and guardrails for preventing OOM conditions.

This module provides memory tracking and enforcement across different platforms, with configurable soft and hard limits, automatic GC hints, and graceful degradation.

Structs§

MemoryGuard
Thread-safe memory guard for monitoring and enforcing memory limits.
MemoryGuardConfig
Memory guard configuration.
MemoryLimitExceeded
Memory limit exceeded error.
MemoryStats
Memory usage statistics.

Functions§

check_sufficient_memory
Check if there’s enough memory for the planned generation.
estimate_memory_mb
Estimate memory needed for generating N journal entries.
get_memory_usage_mb
Get current process memory usage in MB (Linux implementation).