From 92d33e09cea1d62d6a0e6a38b1963687a2f2d7cf Mon Sep 17 00:00:00 2001 From: mdoerr Date: Tue, 29 Jul 2014 10:26:09 +0200 Subject: [PATCH] 8050973: CMS/G1 GC: add missing Resource and Handle mark Summary: Add Resource/HandleMark in the work() method of some AbstractGangTask to reclaim these resources earlier. Reviewed-by: tschatzl, goetz --- .../concurrentMarkSweep/concurrentMarkSweepGeneration.cpp | 2 ++ src/share/vm/gc_implementation/g1/concurrentMark.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index 4868568c0..f96151c90 100644 --- a/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -6051,6 +6051,8 @@ public: }; void CMSRefProcTaskProxy::work(uint worker_id) { + ResourceMark rm; + HandleMark hm; assert(_collector->_span.equals(_span), "Inconsistency in _span"); CMSParKeepAliveClosure par_keep_alive(_collector, _span, _mark_bit_map, diff --git a/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/src/share/vm/gc_implementation/g1/concurrentMark.cpp index 44d0c8f6e..7069862a1 100644 --- a/src/share/vm/gc_implementation/g1/concurrentMark.cpp +++ b/src/share/vm/gc_implementation/g1/concurrentMark.cpp @@ -2403,6 +2403,8 @@ public: } virtual void work(uint worker_id) { + ResourceMark rm; + HandleMark hm; CMTask* task = _cm->task(worker_id); G1CMIsAliveClosure g1_is_alive(_g1h); G1CMKeepAliveAndDrainClosure g1_par_keep_alive(_cm, task, false /* is_serial */); -- GitLab