[fix](memory) fix jemalloc purge arena dirty pages core dump (#21486)

Issue Number: close #xxx

jemalloc/jemalloc#2470
Occasional core dump during stress test.
This commit is contained in:
Xinyi Zou
2023-07-04 20:35:13 +08:00
committed by GitHub
parent 81ee4d7402
commit 3b73604f74

View File

@ -107,9 +107,15 @@ public:
static inline void je_purge_all_arena_dirty_pages() {
#ifdef USE_JEMALLOC
// Purge all unused dirty pages for arena <i>, or for all arenas if <i> equals MALLCTL_ARENAS_ALL.
jemallctl(fmt::format("arena.{}.purge", MALLCTL_ARENAS_ALL).c_str(), nullptr, nullptr,
nullptr, 0);
try {
// Purge all unused dirty pages for arena <i>, or for all arenas if <i> equals MALLCTL_ARENAS_ALL.
jemallctl(fmt::format("arena.{}.purge", MALLCTL_ARENAS_ALL).c_str(), nullptr, nullptr,
nullptr, 0);
} catch (...) {
// https://github.com/jemalloc/jemalloc/issues/2470
// Occasional core dump during stress test.
LOG(WARNING) << "Purge all unused dirty pages for all arenas failed";
}
#endif
}