Memory Pool Configuration

Fragmentation

drawing-4-1678251879.png


Heap Areas

drawing-4-1678251999.png


Default Memory Pool Example

Let’s have a look on an example:

drawing-4-1678255213.png
drawing-4-1678255251.png

 

Memory Pool Example Outcome

Interpret MemoryPoolAnalysis.xlsx

When a permanent block with size 12800 Byte is used for 160 Byte allocation…

12800
 C:\CGI-Studio_3.10\cgi_studio_candera\src\Candera\Engine2D\Core\RenderNode.cpp(66)

      1. Determine the bin according the requested buffer size 
      2. Check the free list of the identified bin
      3. If no block is found in the free list, try to allocate a buffer from the backing heap. 
      4. If the allocation from the backing heap fails, try to allocate from the next larger bins (overflow).

Proper Memory Pool Analysis

Proper Memory Pool Configuration


Wasted Space vs. Unused blocks

drawing-4-1678252820.png


Process of Configuration

Reduce Number of Bins

Reduce the number of bins generously
Too many bins -> many free blocks not used
“Wasted Space” < Not used blocks!

drawing-4-1678253010.png

Choose “Small Bin Limit”

drawing-4-1678254380.png

Result

drawing-4-1678254563.png


Advanced Topics








Revision #2
Created 2023-03-08 04:59:26 UTC by Tsuyoshi.Kato
Updated 2025-04-15 10:18:34 UTC by Tsuyoshi.Kato