From: Stefan <kr...@wi...> - 2007-08-15 23:17:44
|
Hi=20 I am testing/playing/fighting around with ImageMosaicReader and Image=20 Pyramids. After removing and adding some MapLayers repetitively, the whole applicatio= n=20 quickly crashs, starting with the folowing exception in=20 org.geotools.data.shapefile.ShapefileDataStore: > java.io.FileNotFoundException: some.shp (Too many open files) But i don't think that the ShapefileDataStore has much to do with this... Looking at my open files on linux (lsof) showed me that all tiles of the=20 ImageMosaic ( which was already removed as a MapLayer) were still open! I figured that the following piece of code in the main loop in=20 ImageMosaicReader.java near line 835 could be the reason. I would guess tha= t=20 ImageIO.createImageInputStream(imageFile) should to be closed by us after=20 JAI.create ?? > imageFile =3D new File(new StringBuffer(parentLocation).append( > File.separatorChar).append(location).toString()); > pbjImageRead =3D new ParameterBlock(); > pbjImageRead.add(ImageIO.createImageInputStream(imageFile)); > pbjImageRead.add(imageChoice); > pbjImageRead.add(readMetadata); > pbjImageRead.add(readThumbnails); > pbjImageRead.add(verifyInput); > pbjImageRead.add(null); > pbjImageRead.add(null); > pbjImageRead.add(readP); > pbjImageRead.add(null); > loadedImage =3D JAI.create("ImageRead", pbjImageRead); > if (LOGGER.isLoggable(Level.FINE)) > LOGGER.fine("Just read image number " + i); If i am wrong, and JAI needs an open InputStream to get data on demand, th= en=20 how can the FileHandles used my a MapLayer that uses a ImageMosaicReader be= =20 freed when removing the MapLayer??=20 Thanks and greetings, Steve =2D-=20 wiki=C2=B2 - Softwareentwicklung Stefan Kr=C3=BCger Stra=C3=9Fburger Weg 26 53113 Bonn email kr...@wi... phone 0228 9437868 web www.wikisquare.de jabber al...@ja... skype alfonx PGPKey 51B576FD WER MASSENMAILS OHNE BCC SCHREIBT VERSTOESST GEGEN DEN DATENSCHUTZ! |