Skip to content

Implementation of a Incrementally Defragmenting Auto-Sizing Multi-Arena Allocator#3634

Draft
douira wants to merge 2 commits into
CaffeineMC:devfrom
douira:arena-allocator
Draft

Implementation of a Incrementally Defragmenting Auto-Sizing Multi-Arena Allocator#3634
douira wants to merge 2 commits into
CaffeineMC:devfrom
douira:arena-allocator

Conversation

@douira

@douira douira commented May 7, 2026

Copy link
Copy Markdown
Contributor

Refactors the buffer arena to consist of multiple large buffers that are shared by multiple regions with logic to incrementally defragment, allocate, and deallocate them and move regions between them as buffers fill up.

Remaining todos:

  • Limit maximum buffer allocation size more aggressively, even with weird resource packs it's problematic to create too large buffers
  • Add ability to reduce size of buffer when there's just one big buffer left over
  • Scale amount of allowed defragmentation work with size of buffer and number of segments as it doesn't keep up otherwise

Closes #2683
Closes #2233

@douira douira added this to the Upcoming Major milestone May 7, 2026
@douira douira force-pushed the arena-allocator branch 2 times, most recently from f0e2582 to 2c7ed95 Compare May 14, 2026 17:57
@douira douira force-pushed the arena-allocator branch from 2c7ed95 to 9eeb939 Compare June 27, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use TLSF allocation strategy for terrain geometry Geometry buffers are never compacted, leading to excessive VRAM usage

1 participant