diff options
author | Eric Wong <e@80x24.org> | 2024-03-11 19:40:11 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2024-03-12 06:18:18 +0000 |
commit | 298b05cef615ae3d3f1323e805fe135ae5138144 (patch) | |
tree | 5eac79948ec406cbc2c6d153d2a31df1c4a2c5f7 /Documentation | |
parent | 166532d5a7fb7409db8e7877ca961afb60ad28e5 (diff) | |
download | public-inbox-298b05cef615ae3d3f1323e805fe135ae5138144.tar.gz |
I may be mistaken, but I suspect the reason jemalloc handles long-lived processes better than glibc is due to granularity reduction being scaled to larger size classes. This can waste 20% of an individual allocation, but increases the likelyhood of reuse (without splitting/consolidating into other sizes). In other words, glibc seems to try too hard to make the best fit for initial allocations. This ends up being suboptimal over time as those allocations are freed and similar (but not identical) allocations come in. jemalloc sacrifices the best initial fit for better fits over a long process lifetime.
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/public-inbox-tuning.pod | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Documentation/public-inbox-tuning.pod b/Documentation/public-inbox-tuning.pod index 38810ce6..73246144 100644 --- a/Documentation/public-inbox-tuning.pod +++ b/Documentation/public-inbox-tuning.pod @@ -163,6 +163,11 @@ Transport Layer Security (IMAPS, NNTPS, or via STARTTLS) significantly increases memory use of client sockets, be sure to account for that in capacity planning. +Bursts of small object allocations late in process life contribute to +fragmentation of the heap due to arenas (slabs) used internally by Perl. +jemalloc (tested as an LD_PRELOAD on GNU/Linux) appears to reduce +overall fragmentation compared to glibc malloc in long-lived processes. + =head2 Other OS tuning knobs Linux users: the C<sys.vm.max_map_count> sysctl may need to be increased if |