blackducksoftware / ohcount

The Ohloh source code line counter
https://github.com/blackducksoftware/ohcount
GNU General Public License v2.0
257 stars 74 forks source link

Redirect diff output to tmp files. #60

Closed ghost closed 5 years ago

ghost commented 5 years ago

We encountered an issue with popen function. We ran out of disk space couple of times because popen function captures the output in RAM. We do have 30GB of RAM but still, the RAM space was not enough to run multiple ohcount processes. When RAM is not enough the Ohcount process dies abruptly, this leads to orphan tmp files. After a couple of this incidents, tmp folders are pilled up and we ran out of tmp disk space.

To address this problem, we redirect diff's output to tmp file and we read from that file and continue the processing.