* for daemons serving public traffic, MALLOC_MMAP_THRESHOLD_=131072 is
recommended to reduce fragmentation in glibc malloc, while jemalloc
- (tested as an LD_PRELOAD) is another option.
+ (tested as an LD_PRELOAD) is another option (at least for 64-bit).
PublicInbox::WWW
Bursts of small object allocations late in process life contribute to
fragmentation of the heap due to arenas (slabs) used internally by Perl.
glibc malloc users should use C<MALLOC_MMAP_THRESHOLD_=131072> to reduce
-fragmentation from the sliding mmap window. jemalloc (tested as an
-LD_PRELOAD on GNU/Linux) also reduces fragmentation compared to an
-unconfigured glibc malloc in long-lived processes.
+fragmentation from the sliding mmap window. On 64-bit systems, jemalloc
+(tested as an LD_PRELOAD on GNU/Linux) reduces fragmentation at the
+expense of VM space. 32-bit systems may be better off sticking with
+glibc and MALLOC_MMAP_THRESHOLD_.
=head2 Other OS tuning knobs
[Service]
# Setting MALLOC_MMAP_THRESHOLD_=131072 reduces fragmentation by
-# disabling the sliding mmap window in glibc malloc. An LD_PRELOAD for
-# libjemalloc may be added here, instead. jemalloc is more resistant to
-# fragmentation in long-lived daemons than unconfigured glibc malloc.
+# disabling the sliding mmap window in glibc malloc. For 64-bit systems,
+# LD_PRELOAD for libjemalloc may be added here, instead. jemalloc is more
+# resistant to fragmentation in long-lived daemons than unconfigured glibc
+# malloc on systems with large VM space. 32-bit systems may be better
+# off sticking with glibc and MALLOC_MMAP_THRESHOLD_.
Environment = PI_CONFIG=/home/pi/.public-inbox/config \
PATH=/usr/local/bin:/usr/bin:/bin \
TZ=UTC \