I am working with a log file of size 2GB. When heap exceeds max limit, it throws OutOfMemory Error in my log file.
I want to simulate unix command tail -20 native_stdout.log
How do I do this in JAVA?
I cannot read line by line because it has thousands of lines, it is going to take lot of time.
And file I read is streaming one from SFTP serevr.