The EMF / XSD parsing stuff does have some caches; but no I am not aware why this is happening for you. Can you use your IDE profiler or heap management tools to determine what objects are leaking?
You should be able to call parse multiple times if you are reading from the same input stream... -- Jody Garnett On Fri, Apr 21, 2023 at 4:47 AM gero.will...@gmx.net <gero.will...@gmx.net> wrote: > Hello togehter, > > my usecase is using method StreamingParser.parse() in a loop in my java > application (ca. 5000 iterations). Unfortunately this leads to a huge > memory leak. Also this memory can never be released by the garbage > collector. It stays in the old gen heap forever. > > I use > > > https://github.com/geotools/geotools/blob/main/modules/extension/xsd/xsd-core/src/main/java/org/geotools/xsd/StreamingParser.java > > > in this way: > > for(.....) { > > try { > > org.geotools.xsd.StreamingParser parser = new > org.geotools.xsd.StreamingParser(gml, inputStream, Polygon.class); > > polygon = (Polygon) parser.parse(); > > } finally { > > inputStream.close(); > > } > > } > > > > Do you have any idea why that happens? Are you even able to fix it? > > > I use the following maven dependency: > > <dependency> > > <groupId>org.geotools.xsd</groupId> > > <artifactId>gt-xsd-wfs</artifactId> > > <version>27.2</version> > > </dependency> > > > > Best regards, > > Gero > > _______________________________________________ > GeoTools-GT2-Users mailing list > geotools-gt2-us...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users >
_______________________________________________ GeoTools-Devel mailing list GeoTools-Devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-devel