-
Notifications
You must be signed in to change notification settings - Fork 2.5k
jemalloc "extension" for Linux #4971
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
Conversation
…e errors that came from renaming to files to .cpp
|
Same issue after changing to your approach. Seems like intptr_max == int64_max despite being 32bit? Or I am misunderstanding something. Might need to switch to the env variable approach |
|
It could be that the crash is happening in the jemalloc start-up code or so, which might still break even if none of the code is actually used as long as it is compiled in. Perhaps excluding the code entirely is a better idea indeed |
|
All green! @Mytherin |
|
Awesome! Thanks for all the hard work :) |
This PR adds the jemalloc "extension", that we will for 64-bit Linux builds. The default allocator on Linux creates memory fragmentation, which eventually causes allocations to fail (see #3969). jemalloc should do a better job at this. We do not use jemalloc as a global allocator, only our
Allocatorclass calls into jemalloc.I've put "extension" between quotation marks, because jemalloc can only be loaded statically (no
INSTALL/LOADpossible). We've chosen to do this because switching between allocators dynamically causes a bunch of issues with blocks that are allocated while the switch happens.This was much more work than expected, because I've converted jemalloc to C++, and wrapped it in a namespace to prevent conflicts. jemalloc also has a bunch of platform-specific optimizations, which I had to rip out to make it portable.
Somehow this has caused a regression in TPC-DS q72 in my CI runs, which I cannot reproduce locally. Not sure what is going on there.
Happy to receive any feedback!
P.S.: jemalloc works on macos too, but not (yet) on windows, but we will probably not include it on macos since the default allocator is OK