/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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.
*
*/
#include "memory/allocation.hpp"
#include "services/memoryUsage.hpp"
// 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;
private:
enum {
};
int _num_pools;
protected:
public:
enum Name {
Copy,
};
}
virtual bool is_gc_memory_manager() { return false; }
virtual const char* name() = 0;
// GC support
void oops_do(OopClosure* f);
// Static factory methods to get a memory manager of a specific type
static MemoryManager* get_code_cache_memory_manager();
static GCMemoryManager* get_copy_memory_manager();
static GCMemoryManager* get_msc_memory_manager();
static GCMemoryManager* get_parnew_memory_manager();
static GCMemoryManager* get_cms_memory_manager();
static GCMemoryManager* get_psScavenge_memory_manager();
static GCMemoryManager* get_psMarkSweep_memory_manager();
static GCMemoryManager* get_g1YoungGen_memory_manager();
static GCMemoryManager* get_g1OldGen_memory_manager();
};
private:
public:
};
private:
// We keep memory usage of all memory pools
int _usage_array_size;
public:
GCStatInfo(int num_pools);
~GCStatInfo();
return _before_gc_usage_array[pool_index];
}
return _after_gc_usage_array[pool_index];
}
}
}
void clear();
};
private:
// TODO: We should unify the GCCounter and GCMemoryManager statistic
int _num_gc_threads;
volatile bool _notification_enabled;
public:
~GCMemoryManager();
void initialize_gc_stat_info();
bool is_gc_memory_manager() { return true; }
bool recordAccumulatedGCTime);
// Copy out _last_gc_stat to the given destination, returning
// the collection count. Zero signifies no gc has taken place.
};
// These subclasses of GCMemoryManager are defined to include
// GC-specific information.
// TODO: Add GC-specific information
private:
public:
};
private:
public:
};
private:
public:
};
private:
public:
};
private:
public:
};
private:
public:
};
private:
public:
};
private:
public:
};
#endif // SHARE_VM_SERVICES_MEMORYMANAGER_HPP