wolfssl-examples/staticmemory/memory-bucket-optimizer/visualization
Devin AI 592e088800 Add memory bucket optimizer tool
This commit adds a tool to analyze memory allocation patterns from wolfSSL
operations and recommend optimal static memory bucket configurations to
minimize wasted memory. The tool includes:

- Memory bucket optimizer that analyzes allocation logs
- Example application demonstrating optimized bucket usage
- Visualization scripts using gnuplot
- Scripts to run optimization for different TLS operations

The tool helps users find optimal WOLFMEM_BUCKETS and WOLFMEM_DIST
configurations for their specific use cases.

Co-Authored-By: jacob@wolfssl.com <jacob@wolfssl.com>
2025-03-04 01:04:54 +00:00
..
README.md Add memory bucket optimizer tool 2025-03-04 01:04:54 +00:00
allocation_histogram.gp Add memory bucket optimizer tool 2025-03-04 01:04:54 +00:00
bucket_optimization.gp Add memory bucket optimizer tool 2025-03-04 01:04:54 +00:00
generate_data.sh Add memory bucket optimizer tool 2025-03-04 01:04:54 +00:00
memory_heatmap.gp Add memory bucket optimizer tool 2025-03-04 01:04:54 +00:00
memory_usage_over_time.gp Add memory bucket optimizer tool 2025-03-04 01:04:54 +00:00
tls_comparison.gp Add memory bucket optimizer tool 2025-03-04 01:04:54 +00:00

README.md

Memory Bucket Optimizer Visualization

This directory contains gnuplot scripts to visualize the memory allocation patterns and optimization results from the Memory Bucket Optimizer tool.

Scripts

  • allocation_histogram.gp: Visualizes allocation sizes and frequencies
  • bucket_optimization.gp: Visualizes bucket sizes and waste
  • tls_comparison.gp: Compares memory usage for different TLS operations
  • memory_usage_over_time.gp: Visualizes memory usage over time for different bucket configurations
  • memory_heatmap.gp: Creates a heatmap of memory usage by bucket size and operation
  • generate_data.sh: Generates data files for gnuplot

Usage

To generate the visualization plots:

cd visualization
./generate_data.sh

This will generate the following plots:

  • allocation_histogram.png: Histogram of allocation sizes and frequencies
  • bucket_optimization.png: Visualization of bucket sizes and waste
  • tls_comparison.png: Comparison of memory usage for different TLS operations
  • memory_usage_over_time.png: Memory usage over time for different bucket configurations
  • memory_heatmap.png: Heatmap of memory usage by bucket size and operation

Data Files

The scripts generate the following data files:

  • allocation_data.txt: Allocation sizes and frequencies
  • bucket_data.txt: Bucket sizes, counts, waste, and distribution
  • tls_comparison.txt: Memory usage comparison for different TLS operations
  • memory_usage_over_time.txt: Memory usage over time for different bucket configurations
  • memory_heatmap.txt: Memory usage by bucket size and operation