-
Notifications
You must be signed in to change notification settings - Fork 111
[deployer] Use jemalloc2
+ Remove (Janky) memleak
#1489
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
jemalloc2
+ Remove Pyroscope
Until Official Supportjemalloc2
+ Remove (Janky) memleak
Until official Rust Support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces memory leak monitoring with jemalloc allocator integration. The change switches from using BCC-based memleak
monitoring to using the jemalloc2
allocator, which provides better memory efficiency for the deployed binary service.
Key changes:
- Integrates jemalloc allocator via
LD_PRELOAD
in the binary service - Removes the complex memleak monitoring agent and associated infrastructure
- Updates configuration naming from "profiling" to "instrument" for clarity
Reviewed Changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
examples/flood/src/lib.rs | Renames profiling field to instrument in Config struct |
examples/flood/README.md | Updates command line example to use --instrument true instead of --profiling false |
deployer/src/ec2/services.rs | Adds jemalloc preload to binary service and removes entire memleak agent implementation |
deployer/src/ec2/mod.rs | Updates documentation to remove memleak references and correct service descriptions |
deployer/src/ec2/create.rs | Removes memleak agent file creation and deployment steps |
deployer/src/ec2/aws.rs | Removes memleak port from security group configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
echo "0 * * * * /usr/sbin/logrotate /etc/logrotate.d/binary" | crontab - | ||
# Setup pyroscope agent script and timer | ||
sudo ln -s "$(find /usr/lib/linux-tools/*/perf | head -1)" /usr/local/bin/perf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a subtle break over time (and unrelated to these changes)
jemalloc2
+ Remove (Janky) memleak
Until official Rust Supportjemalloc2
+ Remove (Janky) memleak
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #1489 +/- ##
==========================================
+ Coverage 91.72% 91.77% +0.05%
==========================================
Files 280 280
Lines 70579 70541 -38
==========================================
+ Hits 64739 64740 +1
+ Misses 5840 5801 -39
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
In testing, I found that
jemalloc
used significantly less memory than the defaultglibc
allocator (leaving more space for the kernel disk cache and assuaging fears of runaway memory leaks).Instead of integrating this natively into the binary, we just set an ENV variable when running!