I am getting following error on the commented line:
"OutOfMemoryError: Java heap space"
The data.bin file is huge so this error is expected. My question is how exactly do I get around this error? I have seen some stuff like -Xmx1024m or similar, but I don't know how to run that using jgrasp compiler
try {
RandomAccessFile data = new RandomAccessFile("data.bin","rws");
long l = data.length();
long recs = l / 1024;
long cnt = 0;
byte []b = new byte[1024];
while(cnt < recs){
cnt++;
data.readFully(b);
byte []key = Arrays.copyOfRange(b, 0, 24);
byte []value = Arrays.copyOfRange(b, 24, 1024);
en = new TEntry<String, String>(new String(key), new String(value));//ERROR
lst.add(en);
}