// A memory manager is responsible for managing one or more memory pools. // The garbage collector is one type of memory managers responsible // for reclaiming memory occupied by unreachable objects. A Java virtual // machine may have one or more memory managers. It may // add or remove memory managers during execution. // A memory pool can be managed by more than one memory managers.
class MemoryPool; class GCMemoryManager; class OopClosure;
class MemoryManager : public CHeapObj<mtInternal> { protected: enum {
max_num_pools = 10
};
private:
MemoryPool* _pools[max_num_pools]; int _num_pools;
// Static factory methods to get a memory manager of a specific type static MemoryManager* get_code_cache_memory_manager(); static MemoryManager* get_metaspace_memory_manager();
};
class GCStatInfo : public CHeapObj<mtGC> { private:
size_t _index;
jlong _start_time;
jlong _end_time;
// We keep memory usage of all memory pools
MemoryUsage* _before_gc_usage_array;
MemoryUsage* _after_gc_usage_array; int _usage_array_size;
class GCMemoryManager : public MemoryManager { private: // TODO: We should unify the GCCounter and GCMemoryManager statistic
size_t _num_collections;
elapsedTimer _accumulated_timer;
GCStatInfo* _last_gc_stat;
Mutex* _last_gc_lock;
GCStatInfo* _current_gc_stat; int _num_gc_threads; volatilebool _notification_enabled; constchar* _gc_end_message; bool _pool_always_affected_by_gc[MemoryManager::max_num_pools];
// Copy out _last_gc_stat to the given destination, returning // the collection count. Zero signifies no gc has taken place.
size_t get_last_gc_stat(GCStatInfo* dest);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.