I worked with large log files (~ 100 MB) in Java and noticed that gzip can compress them to about ~ 3 MB, making them 35 times smaller.
Therefore, I wonder: Do modern OSs compress files before loading them into memory? It seems silly to use 100 MB of RAM to store a file that really only has 3 MB of information.
Or is it the other way around? Is the process of reading a file (and processing encodings and something else) means that a file that takes 100 MB on disk is actually more than 100 MB in memory?
* bonus points: any preprocessing recommendations I could make for my files before downloading them to reduce the use of JVM memory? (Files have the same format as Apache logs.)
source share