--- old/src/hotspot/share/services/memTracker.cpp 2019-11-21 11:55:41.433480966 +0100 +++ new/src/hotspot/share/services/memTracker.cpp 2019-11-21 11:55:41.181476706 +0100 @@ -183,7 +183,7 @@ // printing the final report during normal VM exit, it should not print // the final report again. In addition, it should be guarded from // recursive calls in case NMT reporting itself crashes. - if (Atomic::cmpxchg(true, &g_final_report_did_run, false) == false) { + if (Atomic::cmpxchg(&g_final_report_did_run, false, true) == false) { NMT_TrackingLevel level = tracking_level(); if (level >= NMT_summary) { report(level == NMT_summary, output);