I have just increased memory to 384 mb but it doesnt work . because my Image is very large in photoshop it is 256mb of memoryof logical memory. I have to do a graphical application and I ?br>doesnt know what image people whant to process ,in this way I have to implement a robust system
of loading image .In java I doesnt know how to do it. can you help me
[quote]
Memory-mapped files allow you to create and modify files that are too big to bring into memory. With a memory-mapped file, you can pretend that the entire file is in memory and that you can access it by simply treating it as a very large array. This approach greatly simplifies the code you write in order to modify the file. Here抯 a small example: Feedback
//: c12:LargeMappedFiles.java
// Creating a very large file using mapping.
// {RunByHand}
// {Clean: test.dat}
import java.io.*;
import java.nio.*;
import java.nio.channels.*;
public class LargeMappedFiles {
static int length = 0x8FFFFFF; // 128 Mb
public static void main(String[] args) throws Exception {
MappedByteBuffer out =
new RandomAccessFile("test.dat", "rw").getChannel()
.map(FileChannel.MapMode.READ_WRITE, 0, length);
for(int i = 0; i < length; i++)
out.put((byte)'x');
System.out.println("Finished writing");
for(int i = length/2; i < length/2 + 6; i++)
System.out.print((char)out.get(i));
}
} ///:~
[/quote]
The above is quote from <Thinking in Java, 3rd ed. Revision 4.0> ,chapter 12.