Ciao Thorsten, I think you are running into an outstanding problem of the shapefile reader. See http://jira.codehaus.org/browse/GEOT-1155.
To solve this problem we should refactor a bit the reader itself, in order to map only some parts at a time of the input file. (Well, I would suggest entirely remove memory mapping, but that's another story). In order to try and tackle this problem you can start java with -XX:MaxDirectMemorySize=128M since the default size of the direct memory size is 64M. Note this memory is not the same memory you can control with -Xmx even though they compete for the same amount of memory allocated to the Java process. Simone. On Wed, Apr 23, 2008 at 11:10 AM, <[EMAIL PROTECTED]> wrote: > Hi all, > > I have problems reading a big shape file. When trying to create a > ShapefileDataStore, I get the following exception: > > I try this: > this.store = new ShapefileDataStore(this.shapeURL); > > java.io.IOException: Für diesen Befehl ist nicht genügend Speicher verfügbar > at sun.nio.ch.FileChannelImpl.map0(Native Method) > at sun.nio.ch.FileChannelImpl.map(Unknown Source) > at > org.geotools.data.shapefile.shp.ShapefileReader.init(ShapefileReader.java:245) > at > org.geotools.data.shapefile.shp.ShapefileReader.<init>(ShapefileReader.java:148) > at > org.geotools.data.shapefile.ShapefileDataStore.openShapeReader(ShapefileDataStore.java:466) > at > org.geotools.data.shapefile.ShapefileDataStore.readAttributes(ShapefileDataStore.java:670) > at > org.geotools.data.shapefile.ShapefileDataStore.getSchema(ShapefileDataStore.java:626) > at > org.geotools.data.shapefile.ShapefileDataStore.getSchema(ShapefileDataStore.java:620) > at > org.geotools.data.shapefile.ShapefileDataStore.getFeatureSource(ShapefileDataStore.java:927) > at > com.ptvag.geomanagement.shapefile.ShapeFileReader.setShapeFilePath(ShapeFileReader.java:89) > at > com.ptvag.geomanagement.servlets.UploadHandlerServlet.collectZipFileInformation(UploadHandlerServlet.java:245) > at > com.ptvag.geomanagement.servlets.UploadHandlerServlet.handleUpload(UploadHandlerServlet.java:165) > at > com.ptvag.geomanagement.servlets.UploadHandlerServlet.doPost(UploadHandlerServlet.java:86) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) > at > org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:407) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) > at java.lang.Thread.run(Unknown Source) > > Do you have any tips how I can read large files? > > Regards, > Thorsten > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save $100. > Use priority code J8TL2D2. > > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Geotools-gt2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > -- ------------------------------------------------------- Eng. Simone Giannecchini President /CEO GeoSolutions S.A.S. Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob: +39 333 8128928 http://www.geo-solutions.it ------------------------------------------------------- ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
