File tree 2 files changed +17
-2
lines changed
com.oracle.svm.core/src/com/oracle/svm/core/jfr/oldobject
com.oracle.svm.test/src/com/oracle/svm/test/jfr/oldobject
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,12 @@ private void remove(JfrOldObject sample) {
120
120
next .increaseSpan (sample .getSpan ());
121
121
queue .add (next );
122
122
} else {
123
- /* No remaining elements, we can't redistribute the weight. */
123
+ /*
124
+ * No younger element, we can't redistribute the weight. The next sample should absorb
125
+ * the extra span.
126
+ */
124
127
totalInQueue = totalInQueue .subtract (sample .getSpan ());
125
- assert totalInQueue .equal (0 );
128
+ assert totalInQueue .aboveOrEqual (0 );
126
129
}
127
130
queue .remove (sample );
128
131
release (sample );
Original file line number Diff line number Diff line change 33
33
import java .util .Collections ;
34
34
import java .util .List ;
35
35
36
+ import jdk .jfr .Recording ;
36
37
import org .graalvm .word .WordFactory ;
37
38
import org .junit .Assert ;
39
+ import org .junit .BeforeClass ;
38
40
import org .junit .Test ;
39
41
40
42
import com .oracle .svm .core .jfr .HasJfrSupport ;
45
47
import jdk .graal .compiler .api .directives .GraalDirectives ;
46
48
47
49
public class TestOldObjectProfiler extends AbstractJfrTest {
50
+
51
+ /*
52
+ * Old object samples will not have allocation ticks set correctly if JfrTicks is not first
53
+ * initialized. We need to create the first JFR recording to lazily initialize JfrTicks.
54
+ */
55
+ @ BeforeClass
56
+ public static void initializeJfrTicks () {
57
+ GraalDirectives .blackhole (new Recording ());
58
+ }
59
+
48
60
@ Test
49
61
public void testScavenge () {
50
62
int count = 10 ;
You can’t perform that action at this time.
0 commit comments