no longer only about UTF-8
Don't do memory mapped file unless it's helpful.

This will hopefully reduce the file locking problems on Windows.
[FIXED JENKINS-15382]

Revisiting the fix. Avoid parsing the entire text by only looking at the tail portion.