Or, it's clever on systems where these temporary files are not themselves held in RAM, which they typically are these days (/tmp/ is typically a tmpfs, which is a RAM-only file system). So, writing these temporary files eats exactly the RAM you're trying to safesave, and you're running out of RAM: your file has 160 million lines, and a quick google suggests it's 11GB of uncompressed data.
Mod Moved Comments To Chat