Dave,

thanks for the reply. I have been using the following code:

URI gmlURI = new URI("...");
GMLDataStore store = new GMLDataStore(gmlURI);
String name = store.getTypeNames()[0];
FeatureSource source = store.getFeatureSource(name); //this is the point
                                                where the leak occurs
FeatureCollection fc = source.getFeatures(q);
(...)                   
FeatureIterator fIt = fc.features();
try {
     while (fIt.hasNext()) {
        Feature feature = fIt.next();
        System.out.println(feature.getID());
        (...)
     }
} finally {
     fc.close(fIt);
}


Do I need to include another "close" statement? However, as the leak 
occurs even before the feature collection is being traversed, this might 
not be the problem. Right? How can I clear the static schema cache? Any 
ideas why the leak occurs if the feature collection has 10 or more but 
not if it has less than 10 features??


Thanks for any further help.

Michael



David Zwiers wrote:
> Micheal,
> 
> There are some internal caches of the parsed schemas that will continue to
> grow. This will not be cahnged for performance reasons within server
> applications.
> 
> The other posibility is that you are not closing the Feature Reader when
> using it ... this would also leak memory (Note: this does not clear the
> static schema cache).
> 
> HTH.
> 
> DZ
> 
> 
> On 8/8/06, Michael Lutz <[EMAIL PROTECTED]> wrote:
>>
>> David,
>>
>> I am having the same problem with version 2.2-RC3. If you had already
>> fixed it in February, shouldn't the fix be included in this version?
>>
>> Strangely enough, the memory leak only occurs if the GML file has at
>> least 10 features.
>>
>> Hope you can help me there.
>>
>> Cheers,
>> Michael

--
Michael Lutz
European Commission - DG Joint Research Centre
Institute for Environment & Sustainability
Spatial Data Infrastructures Unit - T.P. 262
Via E. Fermi 1, 21020 Ispra (VA), Italy
Phone +39 0332 78-6759
Fax   +39 0332 78-6325
WWW   http://ies.jrc.cec.eu.int/sdi.html

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to