Skip to content

Instantly share code, notes, and snippets.

@Skipants
Created October 27, 2010 02:32
Show Gist options
  • Save Skipants/648297 to your computer and use it in GitHub Desktop.
Save Skipants/648297 to your computer and use it in GitHub Desktop.
Calculating Physical Memory Usage
# In Kilobytes
memory_usages = `ps -A -o rss=`.split("\n")
total_mem_usage = memory_usages.inject { |a, e| a.to_i + e.strip.to_i }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment