Class: TestProf::MemoryProf::Tracker::RssTool::ProcFS

Inherits:
Object
  • Object
show all
Defined in:
lib/test_prof/memory_prof/tracker/rss_tool.rb

Instance Method Summary collapse

Constructor Details

#initializeProcFS

Returns a new instance of ProcFS.



10
11
12
13
# File 'lib/test_prof/memory_prof/tracker/rss_tool.rb', line 10

def initialize
  @statm = File.open("/proc/#{$$}/statm", "r")
  @page_size = get_page_size
end

Instance Method Details

#trackObject



15
16
17
18
# File 'lib/test_prof/memory_prof/tracker/rss_tool.rb', line 15

def track
  @statm.seek(0)
  @statm.gets.split(/\s/)[1].to_i * @page_size
end