Skip to content

Out of memory error with executables producing a lot of output #4

@thomie

Description

@thomie

On my laptop with 16GB ram, the following command gets killed by the OOM killer. I believe quickbench is using too much memory from strictly reading the output of hledger register (about 700MB when piped to a file). I also notice quickbench is using considerable CPU time itself, which might skew timing results.

$ cd hledger
$ quickbench -f bench100k.sh 
Running 3 tests 1 times at 2025-02-27 13:15:14 CET:
Killed
$ echo $?
137
$ quickbench --help | head -n1
quickbench 1.0

$ hledger --version
hledger 1.30.1, linux-x86_64

Cause

I believe the cause is the use of readProcessWithExitCode. From the docs for readProcess:

readProcess forks an external process, reads its standard output strictly, blocking until the process terminates, and returns the output string.

Merge request incoming.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions