hotspot/src/share/vm/services/lowMemoryDetector.cpp
bool LowMemoryDetector::has_pending_requests() {
{- -------------------------------------------
(1) 全ての MemoryPool を辿り,
それらに対応づけられている usage sensor および gc usage sensor を
SensorInfo::has_pending_requests() で調べていく.
これらの sensor の中に一つでも pending 状態の通知が存在していれば true を返す.
---------------------------------------- -}
assert(Service_lock->owned_by_self(), "Must own Service_lock");
bool has_requests = false;
int num_memory_pools = MemoryService::num_memory_pools();
for (int i = 0; i < num_memory_pools; i++) {
MemoryPool* pool = MemoryService::get_memory_pool(i);
SensorInfo* sensor = pool->usage_sensor();
if (sensor != NULL) {
has_requests = has_requests || sensor->has_pending_requests();
}
SensorInfo* gc_sensor = pool->gc_usage_sensor();
if (gc_sensor != NULL) {
has_requests = has_requests || gc_sensor->has_pending_requests();
}
}
return has_requests;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.