You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/AbstractCollectionPolicy.java
Copy file name to clipboardExpand all lines: substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/AdaptiveCollectionPolicy.java
+37-35Lines changed: 37 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -33,10 +33,12 @@
33
33
importcom.oracle.svm.core.util.UnsignedUtils;
34
34
35
35
/**
36
-
* A port of HotSpot's ParallelGC adaptive size policy for throughput and footprint, but without the
37
-
* pause time goals. The relevant methods in this class have been adapted from classes
38
-
* {@code PSAdaptiveSizePolicy} and its base class {@code AdaptiveSizePolicy}. Method and variable
39
-
* names have been kept mostly the same for comparability.
36
+
* A garbage collection policy that balances throughput and memory footprint.
37
+
*
38
+
* Much of this is based on HotSpot's ParallelGC adaptive size policy, but without the pause time
39
+
* goals. Many methods in this class have been adapted from classes {@code PSAdaptiveSizePolicy} and
40
+
* its base class {@code AdaptiveSizePolicy}. Method and variable names have been kept mostly the
Copy file name to clipboardExpand all lines: substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/AdaptiveWeightedAverage.java
+16-16Lines changed: 16 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@
29
29
importcom.oracle.svm.core.util.UnsignedUtils;
30
30
31
31
/**
32
-
* A weighted average maintains a running, weighted average of some float value.
32
+
* A weighted average maintains a running, weighted average of some floating-point value.
33
33
*
34
34
* The average is adaptive in that we smooth it for the initial samples; we don't use the weight
35
35
* until we have enough samples for it to be meaningful.
@@ -41,24 +41,24 @@ class AdaptiveWeightedAverage {
41
41
42
42
privatefinalintweight;
43
43
44
-
privatefloataverage;
44
+
privatedoubleaverage;
45
45
privatelongsampleCount;
46
46
privatebooleanisOld;
47
47
48
48
AdaptiveWeightedAverage(intweight) {
49
-
this(weight, 0.0f);
49
+
this(weight, 0);
50
50
}
51
51
52
-
AdaptiveWeightedAverage(intweight, floatavg) {
52
+
AdaptiveWeightedAverage(intweight, doubleavg) {
53
53
this.weight = weight;
54
54
this.average = avg;
55
55
}
56
56
57
-
publicfloatgetAverage() {
57
+
publicdoublegetAverage() {
58
58
returnaverage;
59
59
}
60
60
61
-
publicvoidsample(floatvalue) {
61
+
publicvoidsample(doublevalue) {
62
62
sampleCount++;
63
63
if (!isOld && sampleCount > OLD_THRESHOLD) {
64
64
isOld = true;
@@ -67,10 +67,10 @@ public void sample(float value) {
Copy file name to clipboardExpand all lines: substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/BasicCollectionPolicies.java
+1-4Lines changed: 1 addition & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -40,10 +40,7 @@
40
40
importcom.oracle.svm.core.util.TimeUtils;
41
41
importcom.oracle.svm.core.util.VMError;
42
42
43
-
/**
44
-
* Garbage collection policies. These are referenced by fully-qualified class names and should not
45
-
* be renamed or moved.
46
-
*/
43
+
/** Basic/legacy garbage collection policies. */
47
44
finalclassBasicCollectionPolicies {
48
45
publicstaticclassOptions {
49
46
@Option(help = "Percentage of total collection time that should be spent on young generation collections.")//
Copy file name to clipboardExpand all lines: substratevm/src/com.oracle.svm.core.genscavenge/src/com/oracle/svm/core/genscavenge/CollectionPolicy.java
+5-18Lines changed: 5 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,6 @@
27
27
importorg.graalvm.compiler.options.Option;
28
28
importorg.graalvm.nativeimage.Platform;
29
29
importorg.graalvm.nativeimage.Platforms;
30
-
importorg.graalvm.nativeimage.hosted.Feature;
31
30
importorg.graalvm.word.UnsignedWord;
32
31
33
32
importcom.oracle.svm.core.SubstrateOptions;
@@ -39,12 +38,12 @@
39
38
/** The interface for a garbage collection policy. All sizes are in bytes. */
40
39
publicinterfaceCollectionPolicy {
41
40
finalclassOptions {
42
-
@Option(help = "The garbage collection policy, one of Adaptive, BySpaceAndTime, OnlyCompletely, OnlyIncrementally, NeverCollect, or the fully-qualified name of a custom policy class.")//
throwUserError.abort("Policy %s does not exist. If it is a custom policy class, it must be a fully qualified class name, which might require quotes or escaping.", name);
75
-
}
76
-
if (!CollectionPolicy.class.isAssignableFrom(policyClass)) {
77
-
throwUserError.abort("Policy %s does not extend %s.", name, CollectionPolicy.class.getTypeName());
0 commit comments