Skip to content

Use mimalloc as default memory allocator on client#187

Draft
TheRealMorgenfrue wants to merge 3 commits intomainfrom
mimalloc_client
Draft

Use mimalloc as default memory allocator on client#187
TheRealMorgenfrue wants to merge 3 commits intomainfrom
mimalloc_client

Conversation

@TheRealMorgenfrue
Copy link
Member

Fixes #160

@TheRealMorgenfrue
Copy link
Member Author

TheRealMorgenfrue commented Feb 26, 2026

Note that:

there is WASM support but it is not regularly tested. However, it should just work. > large allocations > 64MiB the memory is not returned because currently in WASM you can only grow memory. The best remedy at this point is to pre-reserve a large "mimalloc arena" from which mimalloc can allocate any block size (huge or small).

@TheRealMorgenfrue
Copy link
Member Author

Cross-referencing this implementation with main might yield some insights into this.

@TheRealMorgenfrue
Copy link
Member Author

In order to pre-reserve memory, a call to mi_reserve_os_memory is needed. However, by building from source, we don't have access to that function. Maybe configure the mimalloc rust wrapper for wasm instead of building from source.

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 mimalloc as default memory allocator on client

1 participant