File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ def to_json(...)
7878 # @attribute [Numeric] The limit for the number of process size increases, before we assume a memory leak.
7979 attr_accessor :increase_limit
8080
81+ # @returns [Integer] Ask the system for the current memory usage.
8182 def memory_usage
8283 System . memory_usage ( @process_id )
8384 end
Original file line number Diff line number Diff line change 77
88module Memory
99 module Leak
10+ # System-specific memory information.
1011 module System
1112 if File . exist? ( "/proc/meminfo" )
13+ # @returns [Integer] The total memory size in bytes.
1214 def self . total_memory_size
1315 File . foreach ( "/proc/meminfo" ) do |line |
1416 if /MemTotal:\s *(?<total>\d +)\s *kB/ =~ line
@@ -17,6 +19,7 @@ def self.total_memory_size
1719 end
1820 end
1921 elsif RUBY_PLATFORM =~ /darwin/
22+ # @returns [Integer] The total memory size in bytes.
2023 def self . total_memory_size
2124 IO . popen ( [ "sysctl" , "hw.memsize" ] , "r" ) do |io |
2225 io . each_line do |line |
You can’t perform that action at this time.
0 commit comments