File tree 1 file changed +7
-3
lines changed
test/jdk/jdk/jfr/event/oldobject
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -55,18 +55,22 @@ public static void main(String[] args) throws Exception {
55
55
r .enable (EventNames .OldObjectSample ).withStackTrace ().with ("cutoff" , "infinity" );
56
56
r .start ();
57
57
TestClassLoader testClassLoader = new TestClassLoader ();
58
- for (Class <?> clazz : testClassLoader .loadClasses (OldObjects .MIN_SIZE / 20 )) {
58
+ for (Class <?> clazz : testClassLoader .loadClasses (OldObjects .MIN_SIZE / 200 )) {
59
59
// Allocate array to trigger sampling code path for interpreter / c1
60
- for (int i = 0 ; i < 20 ; i ++) {
60
+ for (int i = 0 ; i < 200 ; i ++) {
61
61
Object classArray = Array .newInstance (clazz , 20 );
62
- Array .set (classArray , i , clazz .newInstance ());
62
+ // No need to fill whole array
63
+ for (int j = 0 ; j < 5 ; j ++) {
64
+ Array .set (classArray , j , clazz .getConstructors ()[0 ].newInstance ());
65
+ }
63
66
classObjects .add (classArray );
64
67
}
65
68
}
66
69
r .stop ();
67
70
List <RecordedEvent > events = Events .fromRecording (r );
68
71
Events .hasEvents (events );
69
72
for (RecordedEvent e : events ) {
73
+ System .out .println (e );
70
74
RecordedObject object = e .getValue ("object" );
71
75
RecordedClass rc = object .getValue ("type" );
72
76
if (rc .getName ().contains ("TestClass" )) {
You can’t perform that action at this time.
0 commit comments