diff options
| author | Joe Richey <joerichey@google.com> | 2021-05-24 03:42:01 -0700 |
|---|---|---|
| committer | Joe Richey <joerichey@google.com> | 2021-05-24 03:42:01 -0700 |
| commit | b9573511c6deb13e9d56ff28d8420ed99509a742 (patch) | |
| tree | ee4e314ceff92d77a9a36a57db5353fc55609aeb /metadata/policy_test.go | |
| parent | 6f97cc7522ebb2adc56c4bdb278e80bf7b9d3656 (diff) | |
Run the Garbage Collector in the timing loop
Running `crypto.PassphraseHash` in a loop allocates a lot of memory.
Golang is not always prudent about collecting the garbage from previous
runs, resulting in a OOM error on memory-pressured systems.
With a `maxMemoryBytes` of 128 MiB, this change reduces the maximum
resident memory for `fscrypt setup` to 141 MiB (was perviously 405 MiB)
Signed-off-by: Joe Richey <joerichey@google.com>
Diffstat (limited to 'metadata/policy_test.go')
0 files changed, 0 insertions, 0 deletions