--- old/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp 2019-02-27 10:23:35.720544689 +0100 +++ new/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp 2019-02-27 10:23:35.451536510 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -89,7 +89,10 @@ if ((os::elapsedTime() - _last_periodic_gc_attempt_s) > (G1PeriodicGCInterval / 1000.0)) { log_debug(gc, periodic)("Checking for periodic GC."); if (should_start_periodic_gc()) { - Universe::heap()->collect(GCCause::_g1_periodic_collection); + if (!G1CollectedHeap::heap()->attempt_collect(GCCause::_g1_periodic_collection, + false /* retry_on_vmop_failure */)) { + log_debug(gc, periodic)("GC request denied. Skipping."); + } } _last_periodic_gc_attempt_s = os::elapsedTime(); }