memory-profiler 1.1.12 → 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4fb4dabaaccdf849f1226fc675a2ffed0893ee3b1298263c40b42667c544f0b4
4
- data.tar.gz: de34c582331bcd65fa65bda39e41ea5c9fd07ab44fa9c325729011c47f0a5353
3
+ metadata.gz: 2cc3a03e3b76e232615954217c88c54d2077da267793f79c9b5dc5d8463398f6
4
+ data.tar.gz: 29466a48c28857d7093156c80072dc3cba66420275b307cb2fea64102ece2624
5
5
  SHA512:
6
- metadata.gz: c8b7a4c1c3d3eff6c2ff9531847544bf7b9c8be7008615162b9442726066df94d48ab77ce34d0af106ac1376e14a8ede49ed90be8b2e29818b781c6ac34ae8f3
7
- data.tar.gz: bdf055ac783a19b8662a271de7b5493c4c7cbac6b01c0c1a515809a04058262ec6d2c42c96a8f2cbef558edf0c28e35fdbcc3f818c4e5e9d2fc7fb6a11d57d1c
6
+ metadata.gz: 9171990674d31df2af4daa7ed082b696ce1a093cb8f83ba6bab1d82ed1ef2704bb3cb4aef48758db7ba6b815e8729483d8b2124f3f687a77f3029400e1e3bb7b
7
+ data.tar.gz: 4f4845133c13fe67caa4641df912280983d05f4c6e0fca324b0827f0ffbbd040710670e9d3cd1ef6e6ab7d61bbbe22334f89ffbf4286652f4d4e361891f2dfb5
checksums.yaml.gz.sig CHANGED
Binary file
@@ -4,6 +4,7 @@
4
4
  # Copyright, 2025, by Samuel Williams.
5
5
 
6
6
  require "console"
7
+ require "objspace"
7
8
 
8
9
  require_relative "capture"
9
10
  require_relative "call_tree"
@@ -146,15 +147,18 @@ module Memory
146
147
  # @parameter interval [Numeric] Seconds between samples.
147
148
  # @yields {|sample| ...} Called when a class shows significant growth.
148
149
  def run(interval: 60, &block)
149
- start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
150
-
151
150
  while true
151
+ start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
152
+
152
153
  sample!(&block)
153
154
 
155
+ # Log capture statistics to detect issues like missing FREEOBJ events:
156
+ Console.info(self, "Capture statistics:", statistics: @capture.statistics, object_space: ::ObjectSpace.count_objects)
157
+
158
+ # Sleep for the remainder of the interval:
154
159
  now = Process.clock_gettime(Process::CLOCK_MONOTONIC)
155
160
  delta = interval - (now - start_time)
156
161
  sleep(delta) if delta > 0
157
- start_time = now
158
162
  end
159
163
  end
160
164
 
@@ -7,7 +7,7 @@
7
7
  module Memory
8
8
  # @namespace
9
9
  module Profiler
10
- VERSION = "1.1.12"
10
+ VERSION = "1.1.13"
11
11
  end
12
12
  end
13
13
 
data/readme.md CHANGED
@@ -22,6 +22,11 @@ Please see the [project documentation](https://socketry.github.io/memory-profile
22
22
 
23
23
  Please see the [project releases](https://socketry.github.io/memory-profiler/releases/index) for all releases.
24
24
 
25
+ ### v1.1.13
26
+
27
+ - Fix sampler loop interval handling.
28
+ - Log capture statistics from sampler run loop.
29
+
25
30
  ### v1.1.12
26
31
 
27
32
  - Use `rb_obj_id` for tracking object states to avoid compaction issues.
@@ -65,10 +70,6 @@ Please see the [project releases](https://socketry.github.io/memory-profiler/rel
65
70
 
66
71
  - Fix handling of GC compaction (I hope).
67
72
 
68
- ### v0.1.0
69
-
70
- - Initial implementation.
71
-
72
73
  ## Contributing
73
74
 
74
75
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Releases
2
2
 
3
+ ## v1.1.13
4
+
5
+ - Fix sampler loop interval handling.
6
+ - Log capture statistics from sampler run loop.
7
+
3
8
  ## v1.1.12
4
9
 
5
10
  - Use `rb_obj_id` for tracking object states to avoid compaction issues.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memory-profiler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.12
4
+ version: 1.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file