mallopt(M_ARENA_MAX, 4)#119
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a glibc-specific mallopt(M_ARENA_MAX, 4) call in the background worker startup path to reduce virtual memory usage by limiting glibc malloc arenas before gRPC/Arrow-related threads are created.
Changes:
- Add glibc-only
#include <malloc.h>to accessmallopt()/M_ARENA_MAX. - Call
mallopt(M_ARENA_MAX, 4)at the start ofPschBgworkerMain()(glibc-only) to cap arena growth.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
with #121 we're fine to set this to 2 |
There was a problem hiding this comment.
I worry this isn't the full story for cutting back gRPC usage, but seems safe enough to find out.
My main concern was that this should only affect the bgworker, which indeed seems to be the case. Because it's a C++ library, I do worry we could be starting up some gRPC logic in the main process; can't tell that by glancing the code.
2d720f6 to
62e45bd
Compare
|
full story is #121 but this'll help virtual memory usage on fat instances |
No description provided.