--- old/src/share/vm/services/memoryManager.hpp 2018-10-11 23:49:25.981574110 +0000 +++ new/src/share/vm/services/memoryManager.hpp 2018-10-11 23:49:25.871573489 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, 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 @@ -41,11 +41,12 @@ class OopClosure; class MemoryManager : public CHeapObj { -private: +protected: enum { max_num_pools = 10 }; +private: MemoryPool* _pools[max_num_pools]; int _num_pools; @@ -75,7 +76,7 @@ return _pools[index]; } - void add_pool(MemoryPool* pool); + int add_pool(MemoryPool* pool); bool is_manager(instanceHandle mh) { return mh() == _memory_mgr_obj; } @@ -177,10 +178,20 @@ GCStatInfo* _current_gc_stat; int _num_gc_threads; volatile bool _notification_enabled; + bool _pool_always_affected_by_gc[MemoryManager::max_num_pools]; + public: GCMemoryManager(); ~GCMemoryManager(); + void add_pool(MemoryPool* pool); + void add_pool(MemoryPool* pool, bool always_affected_by_gc); + + bool pool_always_affected_by_gc(int index) { + assert(index >= 0 && index < num_memory_pools(), "Invalid index"); + return _pool_always_affected_by_gc[index]; + } + void initialize_gc_stat_info(); bool is_gc_memory_manager() { return true; } @@ -192,7 +203,8 @@ void gc_begin(bool recordGCBeginTime, bool recordPreGCUsage, bool recordAccumulatedGCTime); void gc_end(bool recordPostGCUsage, bool recordAccumulatedGCTime, - bool recordGCEndTime, bool countCollection, GCCause::Cause cause); + bool recordGCEndTime, bool countCollection, GCCause::Cause cause, + bool allMemoryPoolsAffected); void reset_gc_stat() { _num_collections = 0; _accumulated_timer.reset(); }