Raxol.Benchmark.MemoryAnalyzer (Raxol v2.0.1)

View Source

Advanced memory pattern analysis for Raxol benchmarks.

Phase 3 Implementation: Provides deep memory analysis including:

  • Peak vs. sustained memory usage patterns
  • Garbage collection behavior analysis
  • Memory fragmentation detection
  • Memory regression analysis
  • Cross-platform memory behavior

Summary

Functions

Analyzes memory usage patterns from benchmark results.

Detects memory usage patterns and classifies them.

Generates memory optimization recommendations.

Tracks memory usage over time with detailed profiling.

Types

analysis_result()

@type analysis_result() :: %{
  peak_memory: non_neg_integer(),
  sustained_memory: non_neg_integer(),
  gc_collections: non_neg_integer(),
  fragmentation_ratio: float(),
  efficiency_score: float(),
  regression_detected: boolean(),
  platform_differences: map()
}

memory_pattern()

@type memory_pattern() ::
  :linear | :exponential | :logarithmic | :constant | :irregular

Functions

analyze_memory_patterns(benchmark_results, opts \\ [])

@spec analyze_memory_patterns(
  map(),
  keyword()
) :: analysis_result()

Analyzes memory usage patterns from benchmark results.

classify_memory_pattern(memory_samples)

@spec classify_memory_pattern([non_neg_integer()]) :: memory_pattern()

Detects memory usage patterns and classifies them.

generate_recommendations(analysis)

@spec generate_recommendations(analysis_result()) :: [String.t()]

Generates memory optimization recommendations.

profile_memory_over_time(benchmark_function, opts \\ [])

@spec profile_memory_over_time(
  function(),
  keyword()
) :: map()

Tracks memory usage over time with detailed profiling.