mirror of
https://github.com/lloeki/meminfo.git
synced 2025-12-06 01:54:41 +01:00
remove meminfo (ObjectSpace has meminfo_of_all)
This commit is contained in:
parent
9897ae9e22
commit
06f228ab4c
4 changed files with 2 additions and 12 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
meminfo (0.1.0)
|
meminfo (0.1.1)
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,6 @@ module MemInfo
|
||||||
raise ProcessNotFound, pid
|
raise ProcessNotFound, pid
|
||||||
end
|
end
|
||||||
|
|
||||||
def memsize
|
|
||||||
ObjectSpace.each_object.reduce(0) { |a, e| a + ObjectSpace.memsize_of(e) }
|
|
||||||
end
|
|
||||||
|
|
||||||
private def ps_rss(pid)
|
private def ps_rss(pid)
|
||||||
`ps ax -o rss,pid`.each_line.grep(/^\s*(\d+)\s+#{pid}$/) { $1 }.first
|
`ps ax -o rss,pid`.each_line.grep(/^\s*(\d+)\s+#{pid}$/) { $1 }.first
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,3 @@ Process.instance_eval do
|
||||||
MemInfo.rss(pid)
|
MemInfo.rss(pid)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ObjectSpace.instance_eval do
|
|
||||||
def memsize
|
|
||||||
MemInfo.memsize
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
Gem::Specification.new do |s|
|
Gem::Specification.new do |s|
|
||||||
s.name = 'meminfo'
|
s.name = 'meminfo'
|
||||||
s.version = '0.1.0'
|
s.version = '0.1.1'
|
||||||
s.licenses = ['MIT']
|
s.licenses = ['MIT']
|
||||||
s.summary = 'Obtain process memory information'
|
s.summary = 'Obtain process memory information'
|
||||||
s.description = 'Obtain process memory information'
|
s.description = 'Obtain process memory information'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue