-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Leak due to ByteBuffer not being released before garbage collection #3541
Comments
Hi @tkaesler! In rector we have a separate test-suit which ensures that some operators do not leak. This list includes both collectList and reduce operators (see here). That said the problem could be in a different place (e.g. spring data or r2dbc-postgress driver). Thanks, |
@tkaesler I'm closing this issues due to no response. Feel free to reopen once you have any input |
Hi,
Java version: 17
|
Please provide a minimal reproducible example and we can reopen if it shows reactor-core's operators are at fault. |
Hi, i updated versions in example above https://github.com/Dambldore/spring-leak-reproducer and problem still exists:
|
@Dambldore Thanks for the example. I believe you should report this in the r2dbc or spring-data repository. The difference between The issue is with the cancellation of
CC @mp911de: this looks like it is related to r2dbc/r2dbc-pool#198 although this time it's data leaks and not connections. |
When opening a lot of Flux streams and using the
.reduce()
operator on them, after a while (depending on the system and the frequency with which the streams are created), eventuall leak detection alerts because a ByteBuffer was not released before garbage collection.Changing the code from using the
.reduce()
to.collectList().map{it.sum()}
results on no leakage.Funny enough, the data stream is empty in the reproducer.
Expected Behavior
No memory leakage
Actual Behavior
Memory leakage after a certain amount of time.
Steps to Reproduce
Repository with application that reproduces the issue: https://github.com/tkaesler/spring-leak-reproducer
Readme describes setup.
I could not yet reproduce without Spring and the database connection, but am also lacking some knowledge there yet.
java -version
): 17uname -a
): 5.10.0-22-amd64 - Minor cosmetic tweaks for EmitterProcessor #1 SMP Debian 5.10.178-3 (2023-04-22) x86_64 GNU/LinuxThe text was updated successfully, but these errors were encountered: