FeatureReader - Initial memory consumption problem
I already created a question at GIS Stackexchange for this topic.
I am using a (JDBC-) FeatureReader to access features from a PostGis source.
The table contains ~1.150.000 features. I updated the Geotools version from 2.4.5 to 18.2.
The FeatureReader using GT version 18.2 initially allocates ~800MB memory (for ~1.150.000 features) which is a lot more than ~50MB using the older GT version 2.4.5.
The problem is the initial memory consumption when creating (and holding) the FeatureReader. I made the following observations:
The memory consumption is growing with the number of requested features.
The memory consumption decreases after features are read and the reader is closed (no GC problem).
In both cases the used FeatureReader class is org.geotools.jdbc.JDBCFeatureReader
I do not want to load the features into memory. Is this a bug or are there ways to make the FeatureReader more performant using newer versions (> 18) of Geotools?
Confused... fetch size should have a default value of 1000, if not specified... oh, it does in GeoServer because we pick the sample value, but in direct code usage it's not used.
And in that old GeoTools version the fetch size was hard-coded to 1000...