Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jdk17u
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
openjdk
jdk17u
Commits
15c5caa2
Commit
15c5caa2
authored
11 months ago
by
Andrew Lu
Browse files
Options
Downloads
Patches
Plain Diff
8317358: G1: Make TestMaxNewSize use createTestJvm
Backport-of: 1a098356dd3a157b12c2b5c527e61c8a628bdb2d
parent
4650ece6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java
+10
-30
10 additions, 30 deletions
test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java
with
10 additions
and
30 deletions
test/hotspot/jtreg/gc/arguments/TestMaxNewSize.java
+
10
−
30
View file @
15c5caa2
/*
* Copyright (c) 2013, 202
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 202
3
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -28,7 +28,8 @@ package gc.arguments;
* @bug 7057939
* @summary Make sure that MaxNewSize always has a useful value after argument
* processing.
* @requires vm.gc.Serial
* @key flag-sensitive
* @requires vm.gc.Serial & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null & vm.opt.x.Xms == null & vm.opt.x.Xmx == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
...
...
@@ -42,7 +43,8 @@ package gc.arguments;
* @bug 7057939
* @summary Make sure that MaxNewSize always has a useful value after argument
* processing.
* @requires vm.gc.Parallel
* @key flag-sensitive
* @requires vm.gc.Parallel & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null & vm.opt.x.Xms == null & vm.opt.x.Xmx == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
...
...
@@ -56,7 +58,8 @@ package gc.arguments;
* @bug 7057939
* @summary Make sure that MaxNewSize always has a useful value after argument
* processing.
* @requires vm.gc.G1
* @key flag-sensitive
* @requires vm.gc.G1 & vm.opt.MaxNewSize == null & vm.opt.NewRatio == null & vm.opt.NewSize == null & vm.opt.OldSize == null & vm.opt.x.Xms == null & vm.opt.x.Xmx == null
* @library /test/lib
* @library /
* @modules java.base/jdk.internal.misc
...
...
@@ -79,46 +82,23 @@ public class TestMaxNewSize {
private
static
void
checkMaxNewSize
(
String
[]
flags
,
int
heapsize
)
throws
Exception
{
BigInteger
actual
=
new
BigInteger
(
getMaxNewSize
(
flags
));
System
.
out
.
println
(
actual
);
if
(
actual
.
compareTo
(
new
BigInteger
(
(
new
Long
(
heapsize
)).
toString
()))
==
1
)
{
System
.
out
.
println
(
"asserting: "
+
actual
+
" <= "
+
heapsize
);
if
(
actual
.
compareTo
(
new
BigInteger
(
""
+
heapsize
))
>
0
)
{
throw
new
RuntimeException
(
"MaxNewSize value set to \""
+
actual
+
"\", expected otherwise when running with the following flags: "
+
Arrays
.
asList
(
flags
).
toString
());
}
}
private
static
void
checkIncompatibleNewSize
(
String
[]
flags
)
throws
Exception
{
ArrayList
<
String
>
finalargs
=
new
ArrayList
<
String
>();
finalargs
.
addAll
(
Arrays
.
asList
(
flags
));
finalargs
.
add
(
"-version"
);
ProcessBuilder
pb
=
GCArguments
.
createJavaProcessBuilder
(
finalargs
);
OutputAnalyzer
output
=
new
OutputAnalyzer
(
pb
.
start
());
output
.
shouldContain
(
"Initial young gen size set larger than the maximum young gen size"
);
}
private
static
boolean
isRunningG1
(
String
[]
args
)
{
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
if
(
args
[
i
].
contains
(
"+UseG1GC"
))
{
return
true
;
}
}
return
false
;
}
private
static
String
getMaxNewSize
(
String
[]
flags
)
throws
Exception
{
ArrayList
<
String
>
finalargs
=
new
ArrayList
<
String
>();
finalargs
.
addAll
(
Arrays
.
asList
(
flags
));
if
(
isRunningG1
(
flags
))
{
finalargs
.
add
(
"-XX:G1HeapRegionSize=1M"
);
}
finalargs
.
add
(
"-XX:+PrintFlagsFinal"
);
finalargs
.
add
(
"-version"
);
ProcessBuilder
pb
=
GCArguments
.
create
JavaProcessBuilder
(
finalargs
);
ProcessBuilder
pb
=
GCArguments
.
create
TestJvm
(
finalargs
);
OutputAnalyzer
output
=
new
OutputAnalyzer
(
pb
.
start
());
output
.
shouldHaveExitValue
(
0
);
String
stdout
=
output
.
getStdout
();
//System.out.println(stdout);
return
getFlagValue
(
"MaxNewSize"
,
stdout
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment