--- old/src/hotspot/share/gc/z/zMark.cpp 2018-09-18 21:51:59.398758535 +0200 +++ new/src/hotspot/share/gc/z/zMark.cpp 2018-09-18 21:51:59.093745382 +0200 @@ -32,6 +32,7 @@ #include "gc/z/zPageTable.inline.hpp" #include "gc/z/zRootsIterator.hpp" #include "gc/z/zStat.hpp" +#include "gc/z/zStatTLAB.hpp" #include "gc/z/zTask.hpp" #include "gc/z/zThread.hpp" #include "gc/z/zUtils.inline.hpp" @@ -119,11 +120,25 @@ class ZMarkRootsIteratorClosure : public ZRootsIteratorClosure { public: + ZMarkRootsIteratorClosure() { + ZStatTLAB::reset(); + } + + ~ZMarkRootsIteratorClosure() { + ZStatTLAB::publish(); + } + virtual void do_thread(Thread* thread) { ZRootsIteratorClosure::do_thread(thread); // Update thread local address bad mask ZThreadLocalData::set_address_bad_mask(thread, ZAddressBadMask); + + // Retire TLAB + if (UseTLAB && thread->is_Java_thread()) { + thread->tlab().retire(ZStatTLAB::get()); + thread->tlab().resize(); + } } virtual void do_oop(oop* p) {