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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/memory/profiler/sampler.rb +7 -3
- data/lib/memory/profiler/version.rb +1 -1
- data/readme.md +5 -4
- data/releases.md +5 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2cc3a03e3b76e232615954217c88c54d2077da267793f79c9b5dc5d8463398f6
|
|
4
|
+
data.tar.gz: 29466a48c28857d7093156c80072dc3cba66420275b307cb2fea64102ece2624
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
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
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|