Closed WaltonG closed 1 year ago
@antoine2711 @wetneb This PR produces OutOfMemoryError when creating a project. At first it was caused by https://github.com/OpenRefine/SparqlExtension/blob/47121b2532a90e40c73d76bb12b04013074dc1ec/src/main/java/org/openrefine/extensions/sparql/utils/SPARQLQueryResultPreviewReader.java#L141
I changed the declaration to List<Object> rowOfCells = null;
and added values to the list using rowOfCells = Collections.singletonList(jsonRows.get(index++))
This moved the cause to line and I applied the same solution
The cause was then moved to line https://github.com/OpenRefine/SparqlExtension/blob/47121b2532a90e40c73d76bb12b04013074dc1ec/src/main/java/org/openrefine/extensions/sparql/utils/SPARQLQueryResultPreviewReader.java#L162
I commented out the line and now the current error is Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "OkHttp TaskRunner" Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "pool-2-thread-2"
The code was succesfull in fetching the preview data and displaying it but on using the same code to create a project it results to OutOfMemoryError
@antoine2711 can I leave this to you first? Ping me if you are stuck.
@antoine2711 can I leave this to you first? Ping me if you are stuck.
Sure. I was already looking into it.
Regards, Antoine
Just realised that in the database extension two classes that implement TableDataReader were used. One for the preview data and the other for the whole result set that creates the project. I will implement that and see the outcome
Just realised that in the database extension two classes that implement TableDataReader were used. One for the preview data and the other for the whole result set that creates the project. I will implement that and see the outcome
K. You might also have seen this:
java.lang.Error: Unresolved compilation problem:
SPARQLQueryResultPreviewReader cannot be resolved to a type
Regards, Antoine
The error still persists even after implementing create project TableDataReader in a separate java class. Using a small dataset of less that 50 rows gave me a false postive that the error is fixed.
Fixes #3
Changes proposed in this pull request: