4 ms·
On linux you can get a process' memory usage by reading the `/proc` pseudo-filesystem. See [0], which uses that approach when supported. You're correct that p
by semiquaver 9y ago
On linux you can get a process' memory usage by reading the `/proc` pseudo-filesystem. See [0], which uses that approach when supported.
You're correct that production ruby applications should try to avoid calling fork() at runtime, which excludes all the standard library mechanisms for shelling out. posix-spawn [1] is an alternative that works well.
[0] https://github.com/schneems/get_process_mem https://github.com/schneems/get_process_mem
[1] https://github.com/rtomayko/posix-spawn https://github.com/rtomayko/posix-spawn