Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting memory usage of my process from OSX using Ruby

Tags:

macos

ruby

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 system call looks promising but is there an equivalent available from Ruby?

To be clear, I'm looking for a system call, I don't want to kick off a process for this (sorry Lars!).

like image 884
Chris McCauley Avatar asked Nov 09 '10 11:11

Chris McCauley


1 Answers

The OS gem has an rss_bytes method that works for Linux/windows/OS X ...

like image 121
rogerdpack Avatar answered Nov 08 '22 17:11

rogerdpack