memory

Shell memory usage monitoring.

Source: src/execution/builtins.f90:1790-1825

Synopsis

memory [optimize | stats | auto]

Description

Displays and manages the shell's internal memory allocations. Useful for debugging or optimizing long-running shell sessions.

Subcommands

SubcommandDescription
(none)Show summary: current/peak allocations and memory usage
optimizeCompact internal memory pools
statsPrint per-pool capacity and usage breakdown
autoOptimize only if memory usage exceeds 1 MB or 100 allocations

Usage

memory
# Memory Usage Summary:
# Current allocations:            42
# Peak allocations:               87
# Current memory:              32768 bytes
# Peak memory:                 65536 bytes

memory optimize   # Compact pools
memory auto       # Optimize if needed
memory stats      # Detailed breakdown

Exit Status

StatusCondition
0Success
1Unknown subcommand

See Also

  • perf - Performance monitoring