Raxol.Terminal.MemoryManager (Raxol v2.0.1)

View Source

Manages memory usage and limits for the terminal emulator.

Summary

Functions

Checks and cleans up memory if needed.

Returns a specification to start this module under a supervisor.

Estimates memory usage for the given state. Returns the estimated memory usage in bytes.

Gets the memory limit.

Gets the current memory usage.

Gets the current memory usage (alias for get_memory_usage).

Checks if scrolling is needed based on memory usage.

Updates memory usage for the given state.

Checks if the current memory usage is within limits.

Types

t()

@type t() :: %Raxol.Terminal.MemoryManager{
  current_memory: non_neg_integer(),
  max_memory: non_neg_integer(),
  memory_limit: non_neg_integer()
}

Functions

check_and_cleanup(state)

Checks and cleans up memory if needed.

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

estimate_memory_usage(state)

Estimates memory usage for the given state. Returns the estimated memory usage in bytes.

get_limit(memory_manager)

Gets the memory limit.

get_memory_usage(memory_manager)

Gets the current memory usage.

get_usage(memory_manager)

Gets the current memory usage (alias for get_memory_usage).

handle_manager_cast(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_cast/2.

handle_manager_info(msg, state)

Callback implementation for Raxol.Core.Behaviours.BaseManager.handle_manager_info/2.

should_scroll?(memory_manager, state)

Checks if scrolling is needed based on memory usage.

start_link(init_opts \\ [])

update_usage(state)

Updates memory usage for the given state.

within_limits?(memory_manager, state)

Checks if the current memory usage is within limits.