ok, I see,
I had a 32-bit box, the shape files being opened, plus JVM itself, was
bigger than 2GB.....
On Fri, Feb 3, 2012 at 12:15 AM, Yang <[email protected]> wrote:
> see the following stack trace: I used useMemoryMappedBuffer = true for the
> ShapeFileDataStore/ShapeFileReader,
>
> since the shape file is very large (several GBs), the FileChannel.map()
> ran out of memory.
>
> this is a bit strange to me: FileChannel.map() only maps a virtual memory
> space onto the file, it does not need to immediately allocate memory for
> the mapping, right? then why does JVM run out of memory? anyhow, this is
> probably a problem to be addressed since some people will likely choose
> memoryMapped option
>
>
>
> Caused by: java.io.IOException: Map failed
> at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:758)
> at org.geotools.data.shapefile.ShpFiles.map(ShpFiles.java:979)
> at
> org.geotools.data.shapefile.FileChannelDecorator.map(FileChannelDecorator.java:80)
> at
> org.geotools.data.shapefile.shp.ShapefileReader.init(ShapefileReader.java:345)
> at
> org.geotools.data.shapefile.shp.ShapefileReader.<init>(ShapefileReader.java:251)
> at
> org.geotools.data.shapefile.ShapefileDataStore.openShapeReader(ShapefileDataStore.java:558)
> at
> org.geotools.data.shapefile.ShapefileDataStore.readAttributes(ShapefileDataStore.java:785)
> at
> org.geotools.data.shapefile.ShapefileDataStore.getSchema(ShapefileDataStore.java:743)
> at
> org.geotools.data.AbstractFileDataStore.getFeatureSource(AbstractFileDataStore.java:77)
> at my.company.Application.<init>(GeoFinder.java:85)
>
> ... 35 more
> Caused by: java.lang.OutOfMemoryError: Map failed
> at sun.nio.ch.FileChannelImpl.map0(Native Method)
> at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:755)
> ... 46 more
>
>
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users