-
Notifications
You must be signed in to change notification settings - Fork 184
DataRow memory leak #396
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
Comments
Care to attach how |
Here is my mapper:
|
Thank you. May I assume that you no longer hold on to the Row object in your map? Maybe it is just an effect of having proper load in combination with direct buffers. You could switch to unpooled heap buffers instead of direct memory to let GC clean up the buffers. |
How can i switch to unpooled buffers? Thank you. |
Via system property, check out netty/netty#6305 (comment) for all netty property names. Specifically, io.netty.allocator.type=unpooled and io.netty.noPreferDirect=true |
More logs:
|
I tried to reproduce the issue but with no luck using your parameters. My data set had a size of 7M rows. I attached a graph showing memory usage over time. Objects created by the driver are not retained within the mapping function. Code used to reproduce: connection.createStatement("SELECT * from MANY_USERS").execute()
.flatMap(it -> it.map((row, rowMetadata) -> {
// simulate interaction
row.get(0);
row.get(10);
int i = counter.incrementAndGet();
if(i % 1000 == 0) {
System.out.println(i);
}
return new Object();
})).blockLast(); |
Closing as this ticket isn't actionable. If you would like us to look at this issue, please provide additional information and we will re-open the issue. |
Bug Report
Versions
Driver: 0.8.6.RELEASE
Database: PostgreSQL 13.2 (Debian 13.2-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit
Java:
java version "15.0.1" 2020-10-20
Java(TM) SE Runtime Environment (build 15.0.1+9-18)
Java HotSpot(TM) 64-Bit Server VM (build 15.0.1+9-18, mixed mode, sharing)
OS: Ubuntu 18.04.5 LTS
Current Behavior
We are facing a memory leak while executing a select query with a limit of 30m rows. A heap analysis is showing that more than 4m instances of
io.r2dbc.postgresql.message.backend.DataRow
are created in a few seconds. This is not always the case but it is very common if we run the query more than once.This is the JProfiler report after some minutes of execution:

Stack trace
Table schema
Input Code
Steps to reproduce
Input Code
The text was updated successfully, but these errors were encountered: