-
Notifications
You must be signed in to change notification settings - Fork 326
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
Cleanup after each test run #8418
Conversation
WIP: reducing leaks when running our test suite.
e53d95c
to
2c78aec
Compare
2c78aec
to
a04d09b
Compare
Shutdown hook keeps a reference to `RuntimeServerEmulator` which prevents things from being GC'ed.
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.
Congratulations on finding the actual culprit. The memory consumption now seems pretty reasonable as opposed to the previous state.
Eliminating shutdown hooks so that objects get GC'ed.
OK. Let's merge this as-is and I will have further improvements coming for |
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.
I'd suggest to share the cleanup in a single method rather than having it copied dozen times.
context.executionContext.context.close() | ||
context.runtimeServerEmulator.terminate() | ||
if (context != null) { | ||
context.reset() |
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 sequence seems to appear at many places. Shouldn't it be shared at a single place?
@@ -1,4 +1,6 @@ | |||
package org.enso.distribution.locking | |||
|
|||
/** A [[LockManager]] which guarantees to be thread-safe. */ | |||
trait ThreadSafeLockManager extends LockManager | |||
trait ThreadSafeLockManager extends LockManager { | |||
def reset(): Unit |
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.
I think we should have a comment saying what is the purpose of this function.
Pull Request Description
Reducing leaks when running our test suite.
Potentially fixes #8408.
Important Notes
Managed to keep thread count and memory in between runs relatively stable.
Initially:
Now:
The screenshot illustrates for
RuntimeVisualizationsTest
only. Will need to be applied in other places as well.Applying the same style to
runtime-with-instruments
.Before:
After:
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.