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> |
||
---|---|---|
.. | ||
README.md | ||
allocation_histogram.gp | ||
bucket_optimization.gp | ||
generate_data.sh | ||
memory_heatmap.gp | ||
memory_usage_over_time.gp | ||
tls_comparison.gp |
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 frequenciesbucket_optimization.gp
: Visualizes bucket sizes and wastetls_comparison.gp
: Compares memory usage for different TLS operationsmemory_usage_over_time.gp
: Visualizes memory usage over time for different bucket configurationsmemory_heatmap.gp
: Creates a heatmap of memory usage by bucket size and operationgenerate_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 frequenciesbucket_optimization.png
: Visualization of bucket sizes and wastetls_comparison.png
: Comparison of memory usage for different TLS operationsmemory_usage_over_time.png
: Memory usage over time for different bucket configurationsmemory_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 frequenciesbucket_data.txt
: Bucket sizes, counts, waste, and distributiontls_comparison.txt
: Memory usage comparison for different TLS operationsmemory_usage_over_time.txt
: Memory usage over time for different bucket configurationsmemory_heatmap.txt
: Memory usage by bucket size and operation