2076N/A * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2076N/A // No need to hold Service_lock to call out to Java 0N/A// This method could be called from any Java threads 0N/A// and also VMThread. 0N/A// This method could be called from any Java threads 0N/A// and also VMThread. 0N/A // notify sensor state update 0N/A// Only called by VMThread at GC time 0N/A // notify sensor state update 0N/A// recompute enabled flag 0N/A// When this method is used, the memory usage is monitored 0N/A// as a gauge attribute. Sensor notifications (trigger or 0N/A// clear) is only emitted at the first time it crosses 0N/A// High and low thresholds are designed to provide a 0N/A// hysteresis mechanism to avoid repeated triggering 0N/A// of notifications when the attribute value makes small oscillations 0N/A// around the high or low threshold value. 0N/A// The sensor will be triggered if: 0N/A// (1) the usage is crossing above the high threshold and 0N/A// the sensor is currently off and no pending 0N/A// trigger requests; or 0N/A// (2) the usage is crossing above the high threshold and 0N/A// the sensor will be off (i.e. sensor is currently on 0N/A// and has pending clear requests). 0N/A// Subsequent crossings of the high threshold value do not cause 0N/A// any triggers unless the usage becomes less than the low threshold. 0N/A// The sensor will be cleared if: 0N/A// (1) the usage is crossing below the low threshold and 0N/A// the sensor is currently on and no pending 0N/A// clear requests; or 0N/A// (2) the usage is crossing below the low threshold and 0N/A// the sensor will be on (i.e. sensor is currently off 0N/A// and has pending trigger requests). 0N/A// Subsequent crossings of the low threshold value do not cause 0N/A// any clears unless the usage becomes greater than or equal 0N/A// to the high threshold. 0N/A// If the current level is between high and low threhsold, no change. 0N/A // low memory detected and need to increment the trigger pending count 0N/A // if the sensor is off or will be off due to _pending_clear_ > 0 0N/A // Request to trigger the sensor 0N/A // non-zero pending clear requests indicates that there are 0N/A // pending requests to clear this sensor. 0N/A // This trigger request needs to clear this clear count 0N/A // since the resulting sensor flag should be on. 0N/A // memory usage returns below the threshold 0N/A // Request to clear the sensor if the sensor is on or will be on due to 0N/A // _pending_trigger_count > 0 and also no clear request 0N/A// When this method is used, the memory usage is monitored as a 0N/A// simple counter attribute. The sensor will be triggered 0N/A// whenever the usage is crossing the threshold to keep track 0N/A// of the number of times the VM detects such a condition occurs. 0N/A// High and low thresholds are designed to provide a 0N/A// hysteresis mechanism to avoid repeated triggering 0N/A// of notifications when the attribute value makes small oscillations 0N/A// around the high or low threshold value. 0N/A// The sensor will be triggered if: 0N/A// - the usage is crossing above the high threshold regardless 0N/A// of the current sensor state. 0N/A// The sensor will be cleared if: 0N/A// (1) the usage is crossing below the low threshold and 0N/A// the sensor is currently on; or 0N/A// (2) the usage is crossing below the low threshold and 0N/A// the sensor will be on (i.e. sensor is currently off 0N/A// and has pending trigger requests). 2076N/A // Holds Service_lock and update the sensor state 2076N/A // Holds Service_lock and update the sensor state 0N/A//-------------------------------------------------------------- 0N/A tty->
print_cr(
"%s count = %ld pending_triggers = %ld pending_clears = %ld",