forked from openzfs/zfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use jemalloc instead of system's glibc malloc (openzfs#637)
We sometimes see memory usage of the agent process grow very large over time, with the vast majority of it unaccounted for by our allocation tracking. Investigation revealed that most of the memory usage was unallocated parts of the heap, which were likely stranded due to memory fragmentation, exacerbated by periodic floods of large allocations (and then frees a few seconds later) due to zettacache index merging. This commit switches the agent to use jemalloc, which is less subject to memory fragmentation. The process's memory usage (RSS) now more closely tracks the amount of currently-malloc'd memory. Additionally, jemalloc uses less CPU time, and overall performance of zettacache ingestion improved by up to 25%. This commit also implements the alloc_zeroed() and realloc() methods of the GlobalAlloc trait, enabling use of the underlying optimized versions in jemalloc, which contributes to the above mentioned overall performance improvement.
- Loading branch information
Showing
5 changed files
with
137 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters