diff --git a/CHANGELOG.md b/CHANGELOG.md index b35631b..4575195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +## 0.2.1 + +- Reverting back to RSS for linux until (#7) is resolved + ## 0.1.1 + - Bugfix: the `ps` style of memory reporting should always use RSS, and Linux should always use PSS ## 0.1.0 diff --git a/lib/get_process_mem.rb b/lib/get_process_mem.rb index 4bc44f0..8cc87c2 100644 --- a/lib/get_process_mem.rb +++ b/lib/get_process_mem.rb @@ -65,7 +65,7 @@ def mem_type=(mem_type) # linux stores memory info in a file "/proc/#{pid}/smaps" # If it's available it uses less resources than shelling out to ps def linux_memory(file = @process_file) - lines = file.each_line.select {|line| line.match /^Pss/ } + lines = file.each_line.select {|line| line.match /^Rss/ } return if lines.empty? lines.reduce(0) do |sum, line| line.match(/(?(\d*\.{0,1}\d+))\s+(?\w\w)/) do |m| diff --git a/test/get_process_mem_test.rb b/test/get_process_mem_test.rb index 0d79cc5..28eca9e 100644 --- a/test/get_process_mem_test.rb +++ b/test/get_process_mem_test.rb @@ -16,7 +16,7 @@ def test_seems_to_work def test_linux_smap delta = 1 bytes = @mem.linux_memory(fixture_path("heroku-bash-smap")) - assert_in_delta BigDecimal.new("1217024.0"), bytes, delta + assert_in_delta BigDecimal.new("2122240.0"), bytes, delta end def test_conversions