Module: Que::MemoryInfo

Defined in:
lib/memory_info.rb

Constant Summary collapse

KERNEL_PAGE_SIZE =
4096
STATM_PATH =
"/proc/#{Process.pid}/statm"
STATM_FOUND =
File.exist?(STATM_PATH)

Class Method Summary collapse

Class Method Details

.rssObject



6
7
8
# File 'lib/memory_info.rb', line 6

def self.rss
  STATM_FOUND ? (File.read(STATM_PATH).split(' ')[1].to_i * KERNEL_PAGE_SIZE) / (1024 * 1024): 0
end