-
Notifications
You must be signed in to change notification settings - Fork 129
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
Await in loops cause memory leak #56
Comments
I also encountered this problem before. |
What changes did you have to make? |
How to solve the problem |
Original Code:
|
Generated after EA:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I am reporting this observation that came up when we noticed our instances getting OOM killed.
This happens in any sort of loop, if the future completes instantly, no issue, but if it enters the synthetic method that the instrumentation creates, all the completable futures will not be GC'd till that method exits.
If you have this loop logic in one method and another method awaits on it, the problem persists, but now in the "awaiting" method.
If you lets say change infinite loops to limited for's, now the same "build-up" of futures will happen on the method that awaits on the looping method to complete (if that awaiting method is looping/retrying itself).
Recursive calls, separate thread completion and so on all retain the same issue.
Is there a way to attempt fixing this, I am willing to contribute but I lack experience on this specific instrumentation topic.
Thank you.
The text was updated successfully, but these errors were encountered: