leak_profiler 0.7.2 → 0.7.4
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
- data/.rubocop.yml +3 -0
- data/lib/leak_profiler/allocations.rb +6 -3
- data/sig/generated/leak_profiler/allocations.rbs +2 -0
- metadata +6 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 552cd32ae840bec7f18ff3b026c2d3a998a62d65084dc6ece997b0309ca90b26
|
4
|
+
data.tar.gz: bbdf650d238834a39daf03e7853774d3c1a33e6496d52973e4f054c10fa83fe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88abc2cb127b1ed4ac525e9a0e8a97216a5ba579a124da48536381ba599ebd577810bb178318b325049413b46186b39787cee8ab621b3a08e6fde75a70e65982
|
7
|
+
data.tar.gz: 6799cd7a94df9e3bf3ab512a13372a44d778fba22cf83d41b1306529a6539c862ac603836725e4f3b3f0caf73ad1f77291cbd79190c6311d3185002ef11c6510
|
data/.rubocop.yml
CHANGED
@@ -30,8 +30,11 @@ class LeakProfiler
|
|
30
30
|
allocations_by_class = Hash.new { |h, k| h[k] = 0 }
|
31
31
|
|
32
32
|
ObjectSpace.each_object.each do |obj|
|
33
|
-
|
34
|
-
|
33
|
+
begin
|
34
|
+
klass = obj_class(obj)
|
35
|
+
allocations_by_class[klass] += ObjectSpace.memsize_of(obj)
|
36
|
+
rescue StandardError
|
37
|
+
end
|
35
38
|
|
36
39
|
key = allocated_location(obj)
|
37
40
|
next unless key
|
@@ -101,7 +104,7 @@ class LeakProfiler
|
|
101
104
|
ObjectSpace.each_object.each do |obj|
|
102
105
|
r = ObjectSpace.reachable_objects_from(obj)
|
103
106
|
begin
|
104
|
-
if r&.
|
107
|
+
if r&.any? { |o| o.equal?(object) }
|
105
108
|
key = allocated_location(obj)
|
106
109
|
next unless key
|
107
110
|
|
metadata
CHANGED
@@ -1,13 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leak_profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Watson
|
8
|
+
autorequire:
|
8
9
|
bindir: bin
|
9
10
|
cert_chain: []
|
10
|
-
date:
|
11
|
+
date: 2025-09-08 00:00:00.000000000 Z
|
11
12
|
dependencies:
|
12
13
|
- !ruby/object:Gem::Dependency
|
13
14
|
name: logger
|
@@ -57,6 +58,7 @@ metadata:
|
|
57
58
|
homepage_uri: https://github.com/Watson1978/leak_profiler
|
58
59
|
source_code_uri: https://github.com/Watson1978/leak_profiler
|
59
60
|
rubygems_mfa_required: 'true'
|
61
|
+
post_install_message:
|
60
62
|
rdoc_options: []
|
61
63
|
require_paths:
|
62
64
|
- lib
|
@@ -71,7 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
71
73
|
- !ruby/object:Gem::Version
|
72
74
|
version: '0'
|
73
75
|
requirements: []
|
74
|
-
rubygems_version: 3.
|
76
|
+
rubygems_version: 3.5.22
|
77
|
+
signing_key:
|
75
78
|
specification_version: 4
|
76
79
|
summary: A simple profiler for Ruby to detect memory leak.
|
77
80
|
test_files: []
|