Leaks with WFS/GML Schema handling (8.7)
We're experiencing heap leaks that appear to be related to WFS/GML schema handling. We are currently running with GeoTools 8.7.
For background we're running a WPS server utilizing GeoTools to parse and model WFS inputs. These WFS inputs can come from a number of sources, so we deal with a large number of different schemas. Via heap analysis, it appears we're leaking ~250 MB of schema related object instances into heap each week. The processes running on this machine can take days to complete so a "prescribed reboot" is not an ideal option so we'd prefer to resolve the leak.
I've looked for resolutions and i've been able to come up with a reference to GEOT-3473 (
http://jira.codehaus.org/browse/GEOT-3473). The issue addressed appears to relate to leaks during unit testing, but it's not clear how one would properly clean up schema objects for a production system. There's a comment in the GEOT-3473 there stating that no one would ever be parsing a large number of different schemas on a production system (we do!) which leads me to believe that the leak issue wasn't resolved for our use case.
Here's the abridged code we're using...
QName featureTypeSchema = GMLUtil.extractFeatureTypeSchema(file);
String schemaLocation = featureTypeSchema.getLocalPart();
SchemaRepository.registerSchemaLocation(featureTypeSchema.getNamespaceURI(), schemaLocation);
Configuration configuration = new ApplicationSchemaConfiguration(featureTypeSchema.getNamespaceURI(), schemaLocation);
InputStream is = new new BufferedInputStream( new FileInputStream(file), 16 << 10);
StreamingParser parser = new StreamingParser(configuration, inputStream, SimpleFeature.class);
while (parser.hasNext()) {
SimpleFeature feature = parser.parse();
// do something interesting
}
FileUtils.deleteQuietly(file);
configuration.getXSD().dispose(); // what else for schema related clean-up?
With a production environment, It's not clear from looking at GEOT-3473 what else I would need to call and if other clean-up calls would have side-effects for concurrently running parse operations. We have multiple processing operations running concurrently with schemas potentially from the same feature type. So a global clean-up/reset isn't a good option.
Thanks for any insight,
Tom Kunicki
Center for Integrated Data Analytics
U.S. Geological Survey
8505 Research Way
Middleton, WI 53562
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@...
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users