ArenaAllocators and ArrayLists: A Memory Trap
ArenaAllocators don't play nicely with ArrayLists
Arena allocators promise efficient memory management, but they clash with dynamic structures like ArrayLists. When an ArrayList grows, it allocates new memory, copies data, and frees the old—making the old memory non-returnable to the arena. This can lead to up to 3x memory usage. Pre-sizing your ArrayList or avoiding interleaved allocations can mitigate the issue.
Even if you aren't interleaving other allocations with your ArrayList growth, the allocate + copy + free guarantees that old_memory isn't the last allocation.