Write a script to parse a large file such as server logs or dinosaur metrics and extract specific aggregate statistics under memory constraints.