Commit 51e16cc
committed
Revert to jemalloc allocator (#3954)
# Description
This PR makes jemalloc the default memory allocator and simplifies heap
profiling configuration by making it purely runtime-controlled via the
`MALLOC_CONF` environment variable. The reason for switching back to
jemalloc is that with a tuned config, it performs better than mimalloc
and also allows creating memory dumps without redeployments.
# Changes
- **Jemalloc is now the default allocator** (was behind
`jemalloc-profiling` feature).
- **Mimalloc is now optional** via `--features mimalloc-allocator` (was
default).
- All binaries now use jemalloc with built-in heap profiling support by
default.
- Developers can optionally use mimalloc if heap profiling is not needed
or there are problems with the jemalloc allocator.
- Heap profiling is now controlled entirely at runtime via
`MALLOC_CONF=prof:true`
- **Removed** `.github/workflows/deploy-profiling.yaml` (no longer
needed)
- **Updated** `.github/workflows/deploy.yaml` to support optional
`features` parameter
- Currently supported: `mimalloc-allocator`
- Ready for future features to be added (tokio-console will be another
one)
## How to test
Tested on staging and prod. No issues observed. For some reason, on
mainnet-shadow, when active profiling is enabled, liquidity fetching
performance degrades, unlike in other environments (mainnet-prod,
base-prod).
(cherry picked from commit 7829a13)1 parent b9fafe3 commit 51e16cc
File tree
26 files changed
+75
-171
lines changed- .github/workflows
- crates
- alerter
- src
- autopilot
- src
- driver
- src
- infra/observe
- observe
- src
- orderbook
- src
- refunder
- src
- solvers
- src
26 files changed
+75
-171
lines changedThis file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| |||
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| 48 | + | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 13 | + | |
17 | 14 | | |
18 | 15 | | |
19 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 120 | + | |
124 | 121 | | |
125 | | - | |
| 122 | + | |
126 | 123 | | |
127 | | - | |
| 124 | + | |
128 | 125 | | |
129 | 126 | | |
130 | | - | |
| 127 | + | |
131 | 128 | | |
132 | | - | |
| 129 | + | |
133 | 130 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
| 131 | + | |
138 | 132 | | |
139 | 133 | | |
140 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
| 14 | + | |
| 15 | + | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | | - | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
392 | 392 | | |
393 | 393 | | |
394 | 394 | | |
395 | | - | |
| 395 | + | |
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 42 | + | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
| |||
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | | - | |
| 80 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments