Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/gc/gctests/gctest04/gctest04.java
41155 views
1
/*
2
* Copyright (c) 2002, 2021, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
25
/*
26
* @test
27
* @key randomness
28
*
29
* @summary converted from VM Testbase gc/gctests/gctest04.
30
* VM Testbase keywords: [gc]
31
*
32
* @library /vmTestbase
33
* /test/lib
34
* @compile reqgen.java
35
* @run main/othervm gc.gctests.gctest04.gctest04
36
*/
37
38
package gc.gctests.gctest04;
39
40
import nsk.share.test.*;
41
import nsk.share.TestFailure;
42
//gctest04.java
43
44
import nsk.share.TestBug;
45
import nsk.share.TestFailure;
46
47
48
// small objects ( 8 ~ 32k), short live time ( 5 ~ 10 ms)
49
public class gctest04 {
50
public static void main(String args[] )
51
{
52
int queueLimit = 1000;
53
if (args.length > 0)
54
{
55
try
56
{
57
queueLimit = Integer.valueOf(args[0]).intValue();
58
}
59
catch (NumberFormatException e)
60
{
61
throw new TestBug("Bad input to gctest04. Expected integer, " +
62
" got: ->" + args[0] + "<-", e);
63
}
64
}
65
66
67
queue requestque = new queue(queueLimit);
68
reqgen gen = new reqgen(requestque, 5);
69
gen.setsize(8, 32*1024);
70
gen.setlive(5, 10);
71
72
73
reqdisp disp = new reqdisp(requestque);
74
gen.start();
75
disp.start();
76
77
try
78
{
79
gen.join();
80
System.out.println("Joined with gen thread");
81
disp.join();
82
System.out.println("Joined with disp thread");
83
}
84
catch (InterruptedException e)
85
{
86
System.err.println("InterruptedException in gctest04.main()");
87
}
88
System.out.println("Test passed.");
89
}
90
}
91
92