Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Consider support for mimalloc allocator #346

Open
jirutka opened this issue Apr 22, 2024 · 4 comments
Open

[NEW] Consider support for mimalloc allocator #346

jirutka opened this issue Apr 22, 2024 · 4 comments

Comments

@jirutka
Copy link

jirutka commented Apr 22, 2024

Can you please consider adding support for mimalloc (v2) as an alternative to jemalloc? mimalloc is faster in benchmarks and smaller than jemalloc.

Related issues:

@madolson
Copy link
Member

I have nothing against this, especially if it's done in a way that users can opt-in to. We do have some special code to allow for active defragmentation of Jemalloc arenas, so we might also want to figure out how to implement that in mimalloc. Ideally the next step would be for someone to put together a PoC and validate the performance is actually better.

@zuiderkwast
Copy link
Contributor

Agreed. Contributions are welcome.

@PingXie
Copy link
Member

PingXie commented Apr 24, 2024

We do have some special code to allow for active defragmentation of Jemalloc arenas, so we might also want to figure out how to implement that in mimalloc.

defrag is enabled explicitly only when jemalloc is used so this should be fine. in other words, you get defrag with jemalloc only.

I am aligned with adding mimalloc as long as we don't vendor it. On a related note, I think we should move forward and remove the one-off je_get_defrag_hint patch and instead use more generic heuristics for defrag so that other allocators could benefit from the defrag feature as well. jemalloc should be devendored too.

@yairgott
Copy link

yairgott commented Apr 30, 2024

There are indications that jemalloc is faster and uses less memory than mimalloc. See for example: rust-lang/rust-analyzer#1441 (comment)

The used jemalloc version is quite old. The main challenge is related to porting this defrag patch. We need to check what are the alternatives.

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

No branches or pull requests

5 participants