mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-16 05:37:18 +03:00
No description
background_thread_sleep() computed the pthread_cond_timedwait deadline from gettimeofday() (CLOCK_REALTIME). If the wall clock jumps backward (NTP correction, VM snapshot, leap second), the deadline ends up far in the future and the background thread stops purging dirty pages - potentially for hours or days. This was observed in production where NTP corrections caused unbounded RSS growth due to the background thread stalling. Switch deadline computation to nstime_init_update() (which already handles the monotonic vs realtime fallback), and set CLOCK_MONOTONIC on the condvar via pthread_condattr_setclock at both init sites (background_thread_boot1 and background_thread_postfork_child), with fallback to CLOCK_REALTIME if condattr init/setclock fails. |
||
|---|---|---|
| .github/workflows | ||
| bin | ||
| build-aux | ||
| doc | ||
| doc_internal | ||
| include | ||
| m4 | ||
| msvc | ||
| scripts | ||
| src | ||
| test | ||
| .appveyor.yml | ||
| .autom4te.cfg | ||
| .clang-format | ||
| .git-blame-ignore-revs | ||
| .gitattributes | ||
| .gitignore | ||
| .travis.yml | ||
| autogen.sh | ||
| ChangeLog | ||
| config.stamp.in | ||
| configure.ac | ||
| COPYING | ||
| INSTALL.md | ||
| jemalloc.pc.in | ||
| Makefile.in | ||
| README | ||
| run_tests.sh | ||
| TUNING.md | ||
jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support. jemalloc first came into use as the FreeBSD libc allocator in 2005, and since then it has found its way into numerous applications that rely on its predictable behavior. In 2010 jemalloc development efforts broadened to include developer support features such as heap profiling and extensive monitoring/tuning hooks. Modern jemalloc releases continue to be integrated back into FreeBSD, and therefore versatility remains critical. Ongoing development efforts trend toward making jemalloc among the best allocators for a broad range of demanding applications, and eliminating/mitigating weaknesses that have practical repercussions for real world applications. The COPYING file contains copyright and licensing information. The INSTALL file contains information on how to configure, build, and install jemalloc. The ChangeLog file contains a brief summary of changes for each release. URL: https://jemalloc.net/