Exception in thread "main" java.io.IOException: Not enough spaceHowever, even 1GB and 2GB RAM machines were greeted with this!
at sun.nio.ch.FileChannelImpl.map0(Native Method)
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:742)
at Test.main(Test.java:18)
Then after some searching... it turned out to be bug with Java's 1.5 run time environment and with just an upgrade to version 6.0, the code could run!
So if anyone who is still using JDK 5.0 or the JRE 5.0 remember the limitations when mapping files to memory! Also remember to buffer your File input and output streams if you're not using FileChannels!
Here is the bug report:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6417205
No comments:
Post a Comment