/*
* 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 "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/javaCalls.hpp"
#include "services/lowMemoryDetector.hpp"
#include "services/management.hpp"
#include "services/memoryManager.hpp"
#include "services/memoryPool.hpp"
#include "services/memoryService.hpp"
#include "services/gcNotifier.hpp"
#include "utilities/dtrace.hpp"
#ifndef USDT2
#endif /* !USDT2 */
_num_pools = 0;
}
_num_pools++;
}
pool->add_manager(this);
}
return (MemoryManager*) new CodeCacheMemoryManager();
}
return (GCMemoryManager*) new CopyMemoryManager();
}
return (GCMemoryManager*) new MSCMemoryManager();
}
return (GCMemoryManager*) new ParNewMemoryManager();
}
return (GCMemoryManager*) new CMSMemoryManager();
}
return (GCMemoryManager*) new PSScavengeMemoryManager();
}
return (GCMemoryManager*) new PSMarkSweepMemoryManager();
}
return (GCMemoryManager*) new G1YoungGenMemoryManager();
}
return (GCMemoryManager*) new G1OldGenMemoryManager();
}
// Must do an acquire so as to force ordering of subsequent
// loads from anything _memory_mgr_obj points to or implies.
// It's ok for more than one thread to execute the code up to the locked region.
// Extra manager instances will just be gc'ed.
if (is_gc_memory_manager()) {
} else {
}
ik,
&args,
CHECK_0);
{
// Get lock before setting _memory_mgr_obj
// since another thread may have created the instance
// Check if another thread has created the management object. We reload
// _memory_mgr_obj here because some other thread may have initialized
// it while we were executing the code before the lock.
//
// The lock has done an acquire, so the load can't float above it, but
// we need to do a load_acquire as above.
return mgr_obj;
}
// Get the address of the object we created via call_special.
// Use store barrier to make sure the memory accesses associated
// with creating the management object are visible before publishing
// its address. The unlock will publish the store to _memory_mgr_obj
// because it does a release first.
}
}
return mgr_obj;
}
}
// initialize the arrays for memory usage
clear();
}
GCStatInfo::~GCStatInfo() {
}
if (before_gc) {
} else {
}
}
_index = 0;
_start_time = 0L;
_end_time = 0L;
}
_num_collections = 0;
_num_gc_threads = 1;
_notification_enabled = false;
}
delete _last_gc_stat;
delete _last_gc_lock;
delete _current_gc_stat;
}
// tracking concurrent collections we need two objects: one to update, and one to
// hold the publicly available "last (completed) gc" information.
}
bool recordAccumulatedGCTime) {
if (recordAccumulatedGCTime) {
}
// _num_collections now increases in gc_end, to count completed collections
if (recordGCBeginTime) {
}
if (recordPreGCUsage) {
// Keep memory usage of all memory pools
for (int i = 0; i < MemoryService::num_memory_pools(); i++) {
#ifndef USDT2
#else /* USDT2 */
#endif /* USDT2 */
}
}
}
// A collector MUST, even if it does not complete for some reason,
// make a TraceMemoryManagerStats object where countCollection is true,
// to ensure the current gc stat is placed in _last_gc_stat.
bool recordAccumulatedGCTime,
bool recordGCEndTime, bool countCollection,
if (recordAccumulatedGCTime) {
}
if (recordGCEndTime) {
}
if (recordPostGCUsage) {
int i;
// keep the last gc statistics for all memory pools
for (i = 0; i < MemoryService::num_memory_pools(); i++) {
#ifndef USDT2
#else /* USDT2 */
#endif /* USDT2 */
}
// Set last collection usage of the memory pools managed by this collector
for (i = 0; i < num_memory_pools(); i++) {
// Compare with GC usage threshold
}
}
if (countCollection) {
// alternately update two objects making one public when complete
{
// reset the current stat for diagnosability purposes
}
if (is_notification_enabled()) {
}
}
}
if (_last_gc_stat->gc_index() != 0) {
"Must have same array size");
}
return _last_gc_stat->gc_index();
}