davidmoten / davidmoten/rxjava3-jdbc

Getting out of memory Issues

Open
#67 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Java
Stars
13
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Hi, I'm getting some issues when I try to fetch more than one million of rows. I'm Using Spring 3.1.2 Java 17 with webflux.
The code that I'm using to fetch a page is the following:

`
return RxJava3Adapter.flowableToFlux(database
.select(queryString)
.fetchSize(10000)
.get(resultSet -> {

ResultSetMetaData metaData = resultSet.getMetaData();

int columnCount = metaData.getColumnCount();

return Flux.>create(emitter -> {

try {
while (resultSet.next()) {
Map row = new HashMap<>();
for (int i = 1; i <= columnCount; i++) {
String columnName = metaData.getColumnName(i);
Object columnValue = resultSet.getObject(i);
row.put(columnName, columnValue);
}
emitter.next(row);
}
emitter.complete();
} catch (SQLException sqlException) {
emitter.error(sqlException);
}
});
})).flatMap(flux -> flux);`


I'm trying to figure what's wrong and why is getting this out of memory exception.
The exception that is throwing is
`Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "RxCachedWorkerPoolEvictor-1"
`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.