-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed duplicate System.gc() in test #18339
Changes from 3 commits
7e9c5ee
3fc7431
20c5153
21b7d02
39270da
571d8d4
b39dd8d
1b76dbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,8 +72,6 @@ public static void generateGarbageAndCollect(){ | |
} | ||
System.out.println("Finished generating garbage, requesting gc"); | ||
System.gc(); | ||
System.gc(); | ||
System.gc(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should watch this case too. I don't know exact reason we called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should retain two calls to System.gc() |
||
System.out.println("GC complete ?");*/ | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,12 +61,10 @@ public void runTest() throws Exception { | |
} | ||
|
||
protected static void thoroughGCandFinalization() { | ||
System.gc(); | ||
System.gc(); | ||
System.runFinalization(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment as TestObject.java, do we still need to call runFinaliization() and do the additional System.gc()? According to our doc update the finalization should occur from the single System.gc() now. |
||
System.runFinalization(); | ||
System.gc(); | ||
System.gc(); | ||
System.runFinalization(); | ||
System.runFinalization(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmitripivkine Do we still need to call runFinaliization() and do the additional System.gc()? According to our doc update the finalization should occur from the single System.gc() now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory your statement is correct. However I don't know the reason why we call
System.gc()
andSystem.runFinalization()
multiple times. I guess there is a reason. We can try to simplify this code (calling System.gc() twice?) and watch for intermittent failures.