remove meminfo (ObjectSpace has meminfo_of_all)

This commit is contained in:
Loic Nageleisen 2015-07-31 15:27:46 +02:00
parent 9897ae9e22
commit 06f228ab4c
4 changed files with 2 additions and 12 deletions

View file

@ -1,7 +1,7 @@
PATH
remote: .
specs:
meminfo (0.1.0)
meminfo (0.1.1)
GEM
remote: https://rubygems.org/

View file

@ -13,10 +13,6 @@ module MemInfo
raise ProcessNotFound, pid
end
def memsize
ObjectSpace.each_object.reduce(0) { |a, e| a + ObjectSpace.memsize_of(e) }
end
private def ps_rss(pid)
`ps ax -o rss,pid`.each_line.grep(/^\s*(\d+)\s+#{pid}$/) { $1 }.first
end

View file

@ -3,9 +3,3 @@ Process.instance_eval do
MemInfo.rss(pid)
end
end
ObjectSpace.instance_eval do
def memsize
MemInfo.memsize
end
end

View file

@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'meminfo'
s.version = '0.1.0'
s.version = '0.1.1'
s.licenses = ['MIT']
s.summary = 'Obtain process memory information'
s.description = 'Obtain process memory information'