Raxol.Terminal.MemoryManager (Raxol v0.3.0)
View SourceMonitors and manages memory usage for terminal processes.
Can trigger actions like trimming scrollback when limits are exceeded.
Summary
Functions
Checks if memory usage exceeds the limit and performs cleanup if necessary.
Returns a specification to start this module under a supervisor.
Estimates the total memory usage of the terminal state.
Performs memory cleanup operations on relevant terminal components.
Functions
@spec check_and_cleanup(Raxol.Terminal.Integration.State.t()) :: Raxol.Terminal.Integration.State.t()
Checks if memory usage exceeds the limit and performs cleanup if necessary.
This function should be called periodically.
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec estimate_memory_usage(Raxol.Terminal.Integration.State.t()) :: non_neg_integer()
Estimates the total memory usage of the terminal state.
Sums the memory usage of the buffer manager, scroll buffer, and other relevant components. Returns the total in bytes.
@spec perform_cleanup(Raxol.Terminal.Integration.State.t()) :: Raxol.Terminal.Integration.State.t()
Performs memory cleanup operations on relevant terminal components.
Currently focuses on trimming the buffer manager.