Class: TestProf::MemoryProf::Tracker::RssTool::ProcFS
- Inherits:
-
Object
- Object
- TestProf::MemoryProf::Tracker::RssTool::ProcFS
- Defined in:
- lib/test_prof/memory_prof/tracker/rss_tool.rb
Instance Method Summary collapse
-
#initialize ⇒ ProcFS
constructor
A new instance of ProcFS.
- #track ⇒ Object
Constructor Details
#initialize ⇒ ProcFS
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
#track ⇒ Object
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 |