Project

total

0.01
There's a lot of open issues
No release in over a year
Get total memory size of the system
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 5.18.0
= 13.0.6
= 6.5.0
= 1.48.1
= 0.6.0
 Project Readme

EO principles respected here DevOps By Rultor.com We recommend RubyMine

rake Gem Version Maintainability Yard Docs License Test Coverage Hits-of-Code

Total is a Ruby gem to detect the total amount of memory in the system.

First, install it:

$ gem install total

Then, use it like this:

require 'total'
puts Total::Mem.new.bytes

The following platforms are supported:

If the platform is not recognized or is not supported, Total::CantDetect exception will be raised. You should catch it and proceed accordingly, for example:

def total_mb
  Total::Mem.new.bytes / (1024 * 1024)
rescue Total::CantDetect
  512
end

This code will return the actual memory size in Mb, if it can be detected, or 512 otherwise.

That's it.

How to contribute

Read these guidelines. Make sure you build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:

$ bundle update
$ bundle exec rake

If it's clean and you don't see any error messages, submit your pull request.