--- old/src/hotspot/share/gc/g1/g1AllocationContext.hpp 2018-02-20 13:59:48.921246199 +0100 +++ new/src/hotspot/share/gc/g1/g1AllocationContext.hpp 2018-02-20 13:59:48.621234441 +0100 @@ -41,12 +41,4 @@ } }; -class AllocationContextStats: public StackObj { -public: - inline void clear() { } - inline void update(bool full_gc) { } - inline void update_after_mark() { } - inline bool available() { return false; } -}; - #endif // SHARE_VM_GC_G1_G1ALLOCATIONCONTEXT_HPP --- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-02-20 13:59:49.733278024 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-02-20 13:59:49.437266423 +0100 @@ -1989,7 +1989,6 @@ switch (cause) { case GCCause::_java_lang_system_gc: return ExplicitGCInvokesConcurrent; case GCCause::_dcmd_gc_run: return ExplicitGCInvokesConcurrent; - case GCCause::_update_allocation_context_stats_inc: return true; case GCCause::_wb_conc_mark: return true; default : return false; } @@ -2542,8 +2541,6 @@ resize_all_tlabs(); g1_policy()->phase_times()->record_resize_tlab_time_ms((os::elapsedTime() - start) * 1000.0); - allocation_context_stats().update(full); - MemoryService::track_memory_usage(); // We have just completed a GC. Update the soft reference // policy with the new heap occupancy --- old/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2018-02-20 13:59:50.689315493 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.hpp 2018-02-20 13:59:50.381303422 +0100 @@ -222,9 +222,6 @@ // Class that handles archive allocation ranges. G1ArchiveAllocator* _archive_allocator; - // Statistics for each allocation context - AllocationContextStats _allocation_context_stats; - // GC allocation statistics policy for survivors. G1EvacStats _survivor_evac_stats; @@ -277,8 +274,7 @@ // (b) cause == _g1_humongous_allocation // (c) cause == _java_lang_system_gc and +ExplicitGCInvokesConcurrent. // (d) cause == _dcmd_gc_run and +ExplicitGCInvokesConcurrent. - // (e) cause == _update_allocation_context_stats_inc - // (f) cause == _wb_conc_mark + // (e) cause == _wb_conc_mark bool should_do_concurrent_full_gc(GCCause::Cause cause); // indicates whether we are in young or mixed GC mode @@ -580,8 +576,6 @@ // Determines PLAB size for a given destination. inline size_t desired_plab_sz(InCSetState dest); - inline AllocationContextStats& allocation_context_stats(); - // Do anything common to GC's. void gc_prologue(bool full); void gc_epilogue(bool full); @@ -1130,11 +1124,6 @@ // "CollectedHeap" supports. virtual void collect(GCCause::Cause cause); - virtual bool copy_allocation_context_stats(const jint* contexts, - jlong* totals, - jbyte* accuracy, - jint len); - // True iff an evacuation has failed in the most-recent collection. bool evacuation_failed() { return _evacuation_failed; } --- old/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp 2018-02-20 13:59:51.557349513 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp 2018-02-20 13:59:51.261337912 +0100 @@ -57,10 +57,6 @@ // Inline functions for G1CollectedHeap -inline AllocationContextStats& G1CollectedHeap::allocation_context_stats() { - return _allocation_context_stats; -} - // Return the region with the given index. It assumes the index is valid. inline HeapRegion* G1CollectedHeap::region_at(uint index) const { return _hrm.at(index); } --- old/src/hotspot/share/gc/g1/g1CollectedHeap_ext.cpp 2018-02-20 13:59:52.417383219 +0100 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap_ext.cpp 2018-02-20 13:59:52.125371775 +0100 @@ -30,13 +30,6 @@ class STWGCTimer; -bool G1CollectedHeap::copy_allocation_context_stats(const jint* contexts, - jlong* totals, - jbyte* accuracy, - jint len) { - return false; -} - G1Policy* G1CollectedHeap::create_g1_policy(STWGCTimer* gc_timer) { return new G1DefaultPolicy(gc_timer); } --- old/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp 2018-02-20 13:59:53.233415201 +0100 +++ new/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp 2018-02-20 13:59:52.941403756 +0100 @@ -1275,7 +1275,6 @@ // We reclaimed old regions so we should calculate the sizes to make // sure we update the old gen/space data. g1h->g1mm()->update_sizes(); - g1h->allocation_context_stats().update_after_mark(); } void G1ConcurrentMark::complete_cleanup() { --- old/src/hotspot/share/gc/shared/collectedHeap.hpp 2018-02-20 13:59:54.077448280 +0100 +++ new/src/hotspot/share/gc/shared/collectedHeap.hpp 2018-02-20 13:59:53.813437933 +0100 @@ -599,20 +599,6 @@ return (CIFireOOMAt > 1 && _fire_out_of_memory_count >= CIFireOOMAt); } #endif - - public: - // Copy the current allocation context statistics for the specified contexts. - // For each context in contexts, set the corresponding entries in the totals - // and accuracy arrays to the current values held by the statistics. Each - // array should be of length len. - // Returns true if there are more stats available. - virtual bool copy_allocation_context_stats(const jint* contexts, - jlong* totals, - jbyte* accuracy, - jint len) { - return false; - } - }; // Class to set and reset the GC cause for a CollectedHeap. --- old/src/hotspot/share/gc/shared/gcCause.cpp 2018-02-20 13:59:54.857478851 +0100 +++ new/src/hotspot/share/gc/shared/gcCause.cpp 2018-02-20 13:59:54.601468817 +0100 @@ -60,10 +60,6 @@ case _wb_full_gc: return "WhiteBox Initiated Full GC"; - case _update_allocation_context_stats_inc: - case _update_allocation_context_stats_full: - return "Update Allocation Context Stats"; - case _no_gc: return "No GC"; --- old/src/hotspot/share/gc/shared/gcCause.hpp 2018-02-20 13:59:55.689511460 +0100 +++ new/src/hotspot/share/gc/shared/gcCause.hpp 2018-02-20 13:59:55.381499388 +0100 @@ -52,8 +52,6 @@ _wb_young_gc, _wb_conc_mark, _wb_full_gc, - _update_allocation_context_stats_inc, - _update_allocation_context_stats_full, /* implementation independent, but reserved for GC use */ _no_gc, --- old/src/hotspot/share/memory/universe.cpp 2018-02-20 13:59:56.513543755 +0100 +++ new/src/hotspot/share/memory/universe.cpp 2018-02-20 13:59:56.213531997 +0100 @@ -134,7 +134,6 @@ oop Universe::_arithmetic_exception_instance = NULL; oop Universe::_virtual_machine_error_instance = NULL; oop Universe::_vm_exception = NULL; -oop Universe::_allocation_context_notification_obj = NULL; oop Universe::_reference_pending_list = NULL; Array* Universe::_the_empty_int_array = NULL; @@ -213,7 +212,6 @@ f->do_oop((oop*)&_main_thread_group); f->do_oop((oop*)&_system_thread_group); f->do_oop((oop*)&_vm_exception); - f->do_oop((oop*)&_allocation_context_notification_obj); f->do_oop((oop*)&_reference_pending_list); debug_only(f->do_oop((oop*)&_fullgc_alot_dummy_array);) } --- old/src/hotspot/share/memory/universe.hpp 2018-02-20 13:59:57.449580440 +0100 +++ new/src/hotspot/share/memory/universe.hpp 2018-02-20 13:59:57.149568682 +0100 @@ -181,8 +181,6 @@ // the vm thread. static oop _vm_exception; - static oop _allocation_context_notification_obj; - // References waiting to be transferred to the ReferenceHandler static oop _reference_pending_list; @@ -334,9 +332,6 @@ static oop virtual_machine_error_instance() { return _virtual_machine_error_instance; } static oop vm_exception() { return _vm_exception; } - static inline oop allocation_context_notification_obj(); - static inline void set_allocation_context_notification_obj(oop obj); - // Reference pending list manipulation. Access is protected by // Heap_lock. The getter, setter and predicate require the caller // owns the lock. Swap is used by parallel non-concurrent reference --- old/src/hotspot/share/memory/universe.inline.hpp 2018-02-20 13:59:58.297613676 +0100 +++ new/src/hotspot/share/memory/universe.inline.hpp 2018-02-20 13:59:57.981601291 +0100 @@ -41,12 +41,4 @@ return type == T_DOUBLE || type == T_LONG; } -inline oop Universe::allocation_context_notification_obj() { - return _allocation_context_notification_obj; -} - -inline void Universe::set_allocation_context_notification_obj(oop obj) { - _allocation_context_notification_obj = obj; -} - #endif // SHARE_VM_MEMORY_UNIVERSE_INLINE_HPP --- old/src/hotspot/share/runtime/serviceThread.cpp 2018-02-20 13:59:59.181648323 +0100 +++ new/src/hotspot/share/runtime/serviceThread.cpp 2018-02-20 13:59:58.881636565 +0100 @@ -29,7 +29,6 @@ #include "runtime/mutexLocker.hpp" #include "runtime/os.hpp" #include "prims/jvmtiImpl.hpp" -#include "services/allocationContextService.hpp" #include "services/diagnosticArgument.hpp" #include "services/diagnosticFramework.hpp" #include "services/gcNotifier.hpp" @@ -105,8 +104,7 @@ while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) && !(has_jvmti_events = JvmtiDeferredEventQueue::has_events()) && !(has_gc_notification_event = GCNotifier::has_event()) && - !(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification()) && - !(acs_notify = AllocationContextService::should_notify())) { + !(has_dcmd_notification_event = DCmdFactory::has_pending_jmx_notification())) { // wait until one of the sensors has pending requests, or there is a // pending JVMTI event or JMX GC notification to post Service_lock->wait(Mutex::_no_safepoint_check_flag); @@ -132,10 +130,6 @@ if(has_dcmd_notification_event) { DCmdFactory::send_notification(CHECK); } - - if (acs_notify) { - AllocationContextService::notify(CHECK); - } } } --- old/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java 2018-02-20 14:00:00.097684225 +0100 +++ new/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/shared/GCCause.java 2018-02-20 13:59:59.789672153 +0100 @@ -38,8 +38,6 @@ _wb_young_gc ("WhiteBox Initiated Young GC"), _wb_conc_mark ("WhiteBox Initiated Concurrent Mark"), _wb_full_gc ("WhiteBox Initiated Full GC"), - _update_allocation_context_stats_inc ("Update Allocation Context Stats"), - _update_allocation_context_stats_full ("Update Allocation Context Stats"), _no_gc ("No GC"), _no_cause_specified ("Unknown GCCause"), --- old/src/hotspot/share/services/allocationContextService.hpp 2018-02-20 14:00:01.009719969 +0100 +++ /dev/null 2018-01-23 10:28:53.900051571 +0100 @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_VM_SERVICES_ALLOCATION_CONTEXT_SERVICE_HPP -#define SHARE_VM_SERVICES_ALLOCATION_CONTEXT_SERVICE_HPP - -#include "utilities/exceptions.hpp" - -class AllocationContextService: public AllStatic { -public: - static inline bool should_notify(); - static inline void notify(TRAPS); -}; - -bool AllocationContextService::should_notify() { return false; } -void AllocationContextService::notify(TRAPS) { } - -#endif // SHARE_VM_SERVICES_ALLOCATION_CONTEXT_SERVICE_HPP