Fix memory leak in Concurrent/ThreadSafeLocalContextProvider, using Cleaner API for JRuby 10#8561
Fix memory leak in Concurrent/ThreadSafeLocalContextProvider, using Cleaner API for JRuby 10#8561matthias-fratz-bsz wants to merge 1 commit intojruby:10-devfrom
Conversation
|
This could probably land for 10.0.3.0 but we need it green. @matthias-fratz-bsz Could you rebase on current master and re-push to see how it shakes out? |
Uses the Cleaner API to run LocalContext.remove() when a Thread has terminated, but also eagerly calls all LocalContext.remove() on terminate().
d1d57af to
0edaf25
Compare
|
So... rebasing doesn't seem to have helped. There's still a massive number of failures (15 failing, 55 successful, and 3 that still haven't finished after an hour). The theme with these failures seems to be: (...plus a lot of other failures that I don't understand.) To me this looks like I've been trying to merge into the wrong branch. I was trying to merge into @headius Should I change the target branch to |
|
@matthias-fratz-bsz @NC-piercej This is not going to make 10.0.3.0 but I want to work with the two of you to identify and fix all embedding leaks for 10.0.4.0. Perhaps you could stop by the JRuby Matrix chat and we can figure out a plan? |
|
An update: we've had 10.0.3.0 / Java 25 deployed for a while now, and we are no longer seeing tasks recycle for memory issues. So, there is a very good chance that the underlying issue may have been fixed. |
|
@NC-piercej Ok thank you for that update. Please let us know if you see anything else that looks like it may be leaking memory. |
|
@matthias-fratz-bsz I realized I missed a question from you above:
Sorry, we don't have very good documentation about what lives where... You want to use master right now, which always represents the current release line (10.0 in this case). When we start preparing to release 10.1, the
If you can try to rebase on top of master I think these issues will clear up. I'll wait to wipe out the |
|
@matthias-fratz-bsz I attempted to do a rebase myself but it seems like the commit disappears. I suspect because we have the Cleaner commit followed by another that removes it (for Java 8 etc) git believes it has already been applied. So I think the right move would be for me to push a revert of the Cleaner removal and then we'll be back to the Cleaner version. I'll give that a try and push a replacement PR if that appears to work right. |
|
@matthias-fratz-bsz I have pushed #9260 with the revert of the de-Cleaner-ification commit, so 10.0.4.0 forward will use the Cleaner API again. Functionality-wise I don't believe there's any other changes. If you and @NC-piercej have any input there let me know, but otherwise I will merge once it runs green. I'll close this and clean up the confusing branches. |

JRuby 10 requires Java 21+, so it has access to the
CleanerAPI. Tested to still get rid of the memory leak demonstrated by the test case in #8422 .