memoryManager.cpp revision 0
/*
* Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
# include "incls/_precompiled.incl"
# include "incls/_memoryManager.cpp.incl"
_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();
}
// 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
}
GCStatInfo::~GCStatInfo() {
}
for (int i = 0; i < _usage_array_size; i++) {
}
}
if (before_gc) {
} else {
}
}
_num_collections = 0;
_num_gc_threads = 1;
}
delete _last_gc_stat;
}
void GCMemoryManager::initialize_gc_stat_info() {
}
void GCMemoryManager::gc_begin() {
// Keep memory usage of all memory pools
for (int i = 0; i < MemoryService::num_memory_pools(); i++) {
}
}
void GCMemoryManager::gc_end() {
int i;
// keep the last gc statistics for all memory pools
for (i = 0; i < MemoryService::num_memory_pools(); i++) {
}
// 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
}
}