Getting memory usage of my process from OSX using Ruby

后端 未结 3 509
星月不相逢
星月不相逢 2021-02-03 10:49

I have a Ruby app which (on Linux) uses the /proc filesystem to get information on its memory usage. Does anyone know how to get the same information for Mac OSX? The task_info

3条回答
  •  南笙
    南笙 (楼主)
    2021-02-03 11:31

    Referring to this answer it seems like you need to call proc_pidinfo(). I don't think there's a Ruby equivalent, so either you'll have to write a C-extension or use the ruby-ffi gem.

    Other sources indicate Ruby 1.9.2 ships with a built in FFI -- but that version is not delivered with OS X.

提交回复
热议问题