-
Notifications
You must be signed in to change notification settings - Fork 728
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
Conversation
FYI @theresa-m |
...l/cmdLineTests/gcRegressionTests/src/com/ibm/tests/garbagecollector/TestContractionMain.java
Show resolved
Hide resolved
jenkins test sanity,extended xlinux jdk8,jdk11 |
I'm not sure right now what to change to make the 3 tests pass. Could you please give me a hint? |
PR build: https://openj9-jenkins.osuosl.org/job/PullRequest-OpenJ9/4638/
|
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.
LGTM
@@ -66,12 +66,10 @@ public static boolean isFinalized(String name) { | |||
} | |||
|
|||
protected static void thoroughGCandFinalization() { | |||
System.gc(); | |||
System.gc(); | |||
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.
@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.
In theory your statement is correct. However I don't know the reason why we call System.gc()
and System.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.
@@ -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 comment
The 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.
@@ -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 comment
The 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 System.gc()
three times. We do have race condition in Metronome when we can not guarantee Global GC execution even we call it twice.
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.
This should retain two calls to System.gc()
@pshipton What approach do you prefer? We can update all double and triple SystemGC() calls to do single call. However I am almost sure it will introduce number of highly intermittent failures. And we can address these failures by adjusting tests again. Alternatively we can do adjustments more accurate assuming current code is doing necessary operations. So, replace triple SystemGC() call to double, call extra runFinaliization() etc. |
We can reduce the calls to what we think is the minimum required now and then monitor the tests. If System.gc() does finalization then do we just need to call System.gc() twice and remove the rest? |
Or maybe this is the min for those two places. System.gc(); |
Yes, there is what I am thinking about. New single call of SystemGC() includes two calls of GC and single runFinalization(). We can do replacement accordingly:
|
@flooxo pls make the changes as described in #18339 (comment) |
Signed-off-by: Florian Grabmeier <[email protected]>
Signed-off-by: Florian Grabmeier <[email protected]>
Sure, let me know if it is now as intended or if I understood something wrong :) |
Signed-off-by: Florian Grabmeier <[email protected]>
@pshipton @dmitripivkine could you take a second look? Thanks |
jenkins test sanity,extended xlinux jdk8,jdk11 |
Removes that System.gc() is not called repeatedly, but only once in all test files
This PR closes #18335 due to #18044