Skip to content

Commit 939f54c

Browse files
committed
Documentation coverage.
1 parent c1293f1 commit 939f54c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/memory/leak/monitor.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

lib/memory/leak/system.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
module 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|

0 commit comments

Comments
 (0)