Method: LinuxStat::ProcessInfo.memory
- Defined in:
- lib/linux_stat/process_info.rb
.memory(pid = $$) ⇒ Object
memory(pid = $$)
Where pid is the process ID.
By default it is the id of the current process ($$)
It retuns the memory of the process. The value is in kilobytes.
The output is an Integer. For example:
LinuxStat::ProcessInfo.memory
8523.776
If the info isn’t available it will return nil.
172 173 174 |
# File 'lib/linux_stat/process_info.rb', line 172 def memory(pid = $$) LinuxStat::ProcFS.statm_memory(pid) &.fdiv(1000) end |