hotspot/src/share/vm/services/lowMemoryDetector.cpp
void SensorInfo::trigger(int count, TRAPS) {
{- -------------------------------------------
(1) sun.management.Sensor.trigger() を呼び出す.
---------------------------------------- -}
assert(count <= _pending_trigger_count, "just checking");
if (_sensor_obj != NULL) {
klassOop k = Management::sun_management_Sensor_klass(CHECK);
instanceKlassHandle sensorKlass (THREAD, k);
Handle sensor_h(THREAD, _sensor_obj);
Handle usage_h = MemoryService::create_MemoryUsage_obj(_usage, CHECK);
JavaValue result(T_VOID);
JavaCallArguments args(sensor_h);
args.push_int((int) count);
args.push_oop(usage_h);
JavaCalls::call_virtual(&result,
sensorKlass,
vmSymbols::trigger_name(),
vmSymbols::trigger_method_signature(),
&args,
CHECK);
}
{- -------------------------------------------
(1) Sensor の状態を on に変更し, 送信した分だけカウンタを増減しておく.
---------------------------------------- -}
{
// Holds Service_lock and update the sensor state
MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
_sensor_on = true;
_sensor_count += count;
_pending_trigger_count = _pending_trigger_count - count;
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.