struct Hardware::Memory
- Hardware::Memory
- Struct
- Value
- Object
Overview
Memory related informations of your system.
Most values are in kB, except HugePages ones.
memory = Hardware::Memory.new
memory.used # => 2731404
memory.percent.to_i # => 32
Defined in:
memory.crConstructors
-
.new
Creates a new
Hardware::Memory
based on the current memory state.
Instance Method Summary
-
#available
Returns the available memory in KiloBytes.
-
#meminfo : Hash(String, Int64)
Returns an Hash from a parsed
/proc/meminfo
. -
#percent(used : Bool = true) : Float64
Returns either the used/available memory in percentage.
-
#total
Returns the total memory in KiloBytes.
-
#used
Returns the memory used in KiloBytes.