We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98fb99d commit de3a939Copy full SHA for de3a939
harness/harness-common.rb
@@ -75,8 +75,13 @@ def get_rss
75
# Collect our own peak mem usage as soon as reasonable after finishing the last iteration.
76
# This method is only accurate to kilobytes, but is nicely portable and doesn't require
77
# any extra gems/dependencies.
78
- mem = `ps -o rss= -p #{Process.pid}`
79
- 1024 * Integer(mem)
+ begin
+ mem = `ps -o rss= -p #{Process.pid}`
80
+ 1024 * Integer(mem)
81
+ rescue ArgumentError, Errno::ENOENT
82
+ # ps failed (e.g. Nix procps on macOS). Fall back to peak RSS via getrusage.
83
+ get_maxrss || 0
84
+ end
85
end
86
87
0 commit comments