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?