I have a java program which just reads a 12GB file
Reader reader1 = new FileReader(filePath);
try (BufferedReader bufferedReader = new BufferedReader(reader1)) {
String line = bufferedReader.readLine();
while (line != null) {
line = bufferedReader.readLine();
}
}
It takes around 53 seconds to read the file for the first time.
Then i checked if the file is cached or not using RAMMAP, the file is completely cached and it is in standby list.
Again i ran the above program, this time it took around same 53 seconds. Why does the performance not improved even when the file is completed cached by OS buffer.
I also created a RAM DISK, copied the input file in the RAM DISK, then again ran the above code, even now it took around 54 seconds. When RAM IOPS is lot more faster, why it is not reflecting here