test6941923.sh revision 4503
0N/A## @summary test new added flags for gc log rotation 0N/A## some tests require path to find test source dir 0N/Aif [
"${TESTSRC}" =
"" ]
0N/A echo "TESTSRC not set. Using "${
TESTSRC}
" as default" 0N/Aecho "TESTSRC=${TESTSRC}" 0N/A## Adding common setup Variables for running shell tests. 2362N/A echo "Test skipped for Windows" 0N/A# create a small test case 0N/Aimport java.util.Vector; 0N/Apublic class Test implements Runnable 0N/A private boolean _should_stop = false; 0N/A public static void main(String[] args) throws Exception { 0N/A long limit = Long.parseLong(args[0]) * 60L * 1000L; // minutes 0N/A Test t = new Test(); 0N/A Thread thr = new Thread(t); 0N/A long time1 = System.currentTimeMillis(); 0N/A long time2 = System.currentTimeMillis(); 0N/A while (time2 - time1 < limit) { 0N/A Thread.sleep(2000); // 2 seconds 0N/A catch(Exception e) {} 0N/A time2 = System.currentTimeMillis(); 0N/A System.out.print("\r... " + (time2 - time1)/1000 + " seconds"); 0N/A System.out.println(); 0N/A public void set_stop(boolean value) { _should_stop = value; } 0N/A int fix_size = 2048; 0N/A Vector< byte[] > v = new Vector< byte[] >(cap); 0N/A while(!_should_stop) { 0N/A byte[] g = new byte[fix_size]; 0N/A if (cap > 80000) cap = 80000; 0N/A v = new Vector< byte[] >(cap); 0N/A# test for 2 minutes, it will complete circulation of gc log rotation 0N/A#also delete $hotspotlog if it exists 0N/Aoptions=
"-Xloggc:$logfile -XX:+UseConcMarkSweepGC -XX:+PrintGC -XX:+PrintGCDetails -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=1 -XX:GCLogFileSize=$gclogsize" 0N/Aecho "Test gc log rotation in same file, wait for $tts minutes ...." 0N/A# rotation file will be $logfile.0 0N/Aatleast=
0 # at least size of numoffile-1 files >= $gclogsize