MonitorVmStartTerminate.java revision 0
0N/A * Copyright 2004 Sun Microsystems, Inc. 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. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A private static final int SLEEPTIME =
5000;
// sleep time for a sleeper 0N/A "Too few sleepers started: " 0N/A "Started count != terminated count: " 0N/A private static final boolean DEBUG =
false;
0N/A +
": error reading monitoring data: " 0N/A +
" target possibly terminated?");
0N/A +
": " +
"\"" +
cmd +
"\"" +
": ");
0N/A * we don't attempt to attach to the target here as it's 0N/A * now dead and has no jvmstat share memory file. Just see 0N/A * if the process id is among those that we saved when we 0N/A * started the targets (note - duplicated allowed and somewhat 0N/A * expected on windows); 0N/A synchronized (
this) {
0N/A // process hasn't exited yet 0N/A synchronized(
this) {
0N/A "IOException trying to start Sleeper " + i +
": " 0N/A // spin waiting for the processes to terminate 0N/A // give final termination event a change to propogate to