[Bug 281471] ASLR: jemalloc RES memory keeps on increasing until process cores
Date: Fri, 13 Sep 2024 07:51:22 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281471
Brooks Davis <brooks@FreeBSD.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |brooks@FreeBSD.org
--- Comment #3 from Brooks Davis <brooks@FreeBSD.org> ---
There was a commit in June to reduce jemalloc induced fragmentation which
describes a somewhat different scenerio. It has not been merged to any
non-main branch, but might be relevant?
commit 268f19aacc6af8f64c438e8515213023a2e66ed7
Author: Alan Cox <alc@FreeBSD.org>
Date: Sun Jun 9 11:58:27 2024 -0500
vm: Reduce address space fragmentation
jemalloc performs two types of virtual memory allocations: (1) large
chunks of virtual memory, where the chunk size is a multiple of a
superpage and explicitly aligned, and (2) small allocations, mostly
128KB, where no alignment is requested. Typically, it starts with a
small allocation, and over time it makes both types of allocation.
With anon_loc being updated on every allocation, we wind up with a
repeating pattern of a small allocation, a large gap, and a large,
aligned allocation. (As an aside, we wind up allocating a reservation
for these small allocations, but it will never fill because the next
large, aligned allocation updates anon_loc, leaving a gap that will
never be filled with other small allocations.)
With this change, anon_loc isn't updated on every allocation. So, the
small allocations will be clustered together, the large allocations will
be clustered together, and there will be fewer gaps between the
anonymous memory allocations. In addition, I see a small reduction in
reservations allocated (e.g., 1.6% during buildworld), fewer partially
populated reservations, and a small increase in 64KB page promotions on
arm64.
Reviewed by: kib
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D39845
--
You are receiving this mail because:
You are the assignee for the bug.