Trying to open a large file (about 128KB) in a java application causes a Map Failed error:
> java.io.IOException: Map failed at > uk.ac.starlink.table.QueueTableSequence.nextTable(QueueTableSequence.java:79) > at > uk.ac.starlink.table.StarTableFactory$1.nextTable(StarTableFactory.java:990) > at > uk.ac.starlink.table.gui.TableLoadWorker.run(TableLoadWorker.java:143) > Caused by: java.io.IOException: Map failed at > sun.nio.ch.FileChannelImpl.map(Unknown Source) at > uk.ac.starlink.fits.SimpleMappedInput.<init>(SimpleMappedInput.java:41) > at > uk.ac.starlink.fits.InputFactory$2.createInput(InputFactory.java:130) > at > uk.ac.starlink.fits.BintableStarTable$RandomBintableStarTable.<init>(BintableStarTable.java:550) > at > uk.ac.starlink.fits.BintableStarTable.createTable(BintableStarTable.java:399) > at > uk.ac.starlink.fits.FitsTableBuilder.attemptReadTableData(FitsTableBuilder.java:424) > at > uk.ac.starlink.fits.FitsTableBuilder.attemptReadTable(FitsTableBuilder.java:393) > at > uk.ac.starlink.fits.FitsTableBuilder.access$000(FitsTableBuilder.java:46) > at > uk.ac.starlink.fits.FitsTableBuilder$MultiLoadWorker.multiLoad(FitsTableBuilder.java:588) > at > uk.ac.starlink.fits.FitsTableBuilder$MultiLoadWorker.run(FitsTableBuilder.java:567) > Caused by: java.lang.OutOfMemoryError: Map failed at > sun.nio.ch.FileChannelImpl.map0(Native Method) ... 10 more
I tried searching for an answer on this site, but the only similar cases that I could find were with loading code into frameworks. Take this one, for instance, Java Large File Upload throws java.io.IOException: Map failed. Application that I'm working with is a .jar file (more info here - http://www.star.bris.ac.uk/~mbt/topcat/), and the file I'm trying to load is of .fits type.
Can you please give me some advice concerning this problem? I'm using JRE build 1.8.0_73
Update: The error only seems to appear when I increase maximum heap size. When keeping the default setting everything works fine.