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