メモリプールとは何か?
メモリプールは、あらかじめ大きなメモリのブロックを予約し、そこから多数の小さなアロケーションを、通常は固定サイズのスロットとして提供するアロケータです。解放はスロットをシステムのアロケータに返すのではなく、再利用のためにプールへ戻します。これにより、頻繁な汎用アロケーションのオーバーヘッドとフラグメンテーションを避けられます。
なぜ重要か
プールは、多数の類似したオブジェクトを次々に消費するワークロードに対してアロケーションを高速かつ予測可能にし、これはホットパスやリアルタイムシステムで重要です。コストは、メモリを事前に予約することとプールのライフサイクルを管理することです。
関連ガイド
What Is an Arena Allocator?An arena allocator carves allocations from one big region and frees them all at once when the arena is reset,…
What Is a Stack Frame?A stack frame is the block of stack memory for one function call, holding its arguments, local variables, and…
What Is Boxing?Boxing wraps a value type in a heap-allocated object so it can be used where a reference or common interface…