--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2019-02-28 10:16:48.772425980 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2019-02-28 10:16:48.498417649 +0100 @@ -2113,10 +2113,10 @@ } void G1CollectedHeap::collect(GCCause::Cause cause) { - attempt_collect(cause, true); + try_collect(cause, true); } -bool G1CollectedHeap::attempt_collect(GCCause::Cause cause, bool retry_on_gc_failure) { +bool G1CollectedHeap::try_collect(GCCause::Cause cause, bool retry_on_gc_failure) { assert_heap_not_locked(); bool gc_succeeded; --- old/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2019-02-28 10:16:49.965462254 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2019-02-28 10:16:49.694454014 +0100 @@ -1063,8 +1063,8 @@ // Perform a collection of the heap with the given cause; if the VM operation // fails to execute for any reason, retry only if retry_on_gc_failure is set. - // Returns whether this collection attempt actually executed. - bool attempt_collect(GCCause::Cause cause, bool retry_on_gc_failure); + // Returns whether this collection actually executed. + bool try_collect(GCCause::Cause cause, bool retry_on_gc_failure); // True iff an evacuation has failed in the most-recent collection. bool evacuation_failed() { return _evacuation_failed; } --- old/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp 2019-02-28 10:16:51.121497403 +0100 +++ new/src/hotspot/share/gc/g1/g1YoungRemSetSamplingThread.cpp 2019-02-28 10:16:50.848489102 +0100 @@ -89,7 +89,7 @@ if ((os::elapsedTime() - _last_periodic_gc_attempt_s) > (G1PeriodicGCInterval / 1000.0)) { log_debug(gc, periodic)("Checking for periodic GC."); if (should_start_periodic_gc()) { - if (!G1CollectedHeap::heap()->attempt_collect(GCCause::_g1_periodic_collection, + if (!G1CollectedHeap::heap()->try_collect(GCCause::_g1_periodic_collection, false /* retry_on_vmop_failure */)) { log_debug(gc, periodic)("GC request denied. Skipping."); } --- old/test/hotspot/jtreg/gc/g1/TestPeriodicCollectionJNI.java 2019-02-28 10:16:52.284532764 +0100 +++ new/test/hotspot/jtreg/gc/g1/TestPeriodicCollectionJNI.java 2019-02-28 10:16:51.997524038 +0100 @@ -62,12 +62,12 @@ long timeout = 2000; long startTime = System.currentTimeMillis(); - // start CS locker thread + // Start thread doing JNI call BlockInNative blocker = new BlockInNative(); blocker.start(); try { - // check timeout to success deadlocking + // Wait for periodic GC timeout to trigger while (System.currentTimeMillis() < startTime + timeout) { System.out.println("Sleeping to let periodic GC trigger..."); Thread.sleep(200); @@ -86,4 +86,3 @@ native void unlock(); } - --- old/test/hotspot/jtreg/gc/g1/libTestPeriodicCollectionJNI.c 2019-02-28 10:16:53.420567304 +0100 +++ new/test/hotspot/jtreg/gc/g1/libTestPeriodicCollectionJNI.c 2019-02-28 10:16:53.131558517 +0100 @@ -68,4 +68,3 @@ #ifdef __cplusplus } #endif -