< prev index next >
src/share/vm/services/memoryManager.hpp
Print this page
@@ -1,7 +1,7 @@
/*
- * 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -39,15 +39,16 @@
class MemoryPool;
class GCMemoryManager;
class OopClosure;
class MemoryManager : public CHeapObj<mtInternal> {
-private:
+protected:
enum {
max_num_pools = 10
};
+private:
MemoryPool* _pools[max_num_pools];
int _num_pools;
protected:
volatile instanceOop _memory_mgr_obj;
@@ -73,11 +74,11 @@
MemoryPool* get_memory_pool(int index) {
assert(index >= 0 && index < _num_pools, "Invalid index");
return _pools[index];
}
- void add_pool(MemoryPool* pool);
+ int add_pool(MemoryPool* pool);
bool is_manager(instanceHandle mh) { return mh() == _memory_mgr_obj; }
virtual instanceOop get_memory_manager_instance(TRAPS);
virtual MemoryManager::Name kind() { return MemoryManager::Abstract; }
@@ -175,14 +176,24 @@
GCStatInfo* _last_gc_stat;
Mutex* _last_gc_lock;
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; }
jlong gc_time_ms() { return _accumulated_timer.milliseconds(); }
size_t gc_count() { return _num_collections; }
@@ -190,11 +201,12 @@
void set_num_gc_threads(int count) { _num_gc_threads = count; }
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(); }
// Copy out _last_gc_stat to the given destination, returning
// the collection count. Zero signifies no gc has taken place.
< prev index next >