heap-profiler 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/heap_profiler/diff.rb +1 -0
- data/lib/heap_profiler/reporter.rb +7 -5
- data/lib/heap_profiler/results.rb +4 -2
- data/lib/heap_profiler/runtime.rb +2 -2
- data/lib/heap_profiler/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aca11eaccc68d8f62bd6ca0150f55ec43efa688ec9904682945b838c6b181afc
|
4
|
+
data.tar.gz: f46324b582fd4b4f840debd5efdf9418218d60e58ed84697848c4664b084523c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 825b314692a3a2f9673f5935fa66e42555ea35f9c72527e74fca906a32b90d24d6a7fc8247b5112b4c9d70baf03c3192938c770137833862380ed814f9863566
|
7
|
+
data.tar.gz: 2667a8bcdc9722114309a5136d58dbed32f06a964ed396940aebc7825a50b20f8fd85e8a73f4ae5103cb8e652b518db96101ccbe53cdf76147e3fffb02b52ad3
|
data/Gemfile.lock
CHANGED
data/lib/heap_profiler/diff.rb
CHANGED
@@ -35,9 +35,11 @@ module HeapProfiler
|
|
35
35
|
@dir_path = dir_path
|
36
36
|
@enable_tracing = !allocation_tracing_enabled?
|
37
37
|
@generation = nil
|
38
|
+
@partial = true
|
38
39
|
end
|
39
40
|
|
40
|
-
def start
|
41
|
+
def start(partial: true)
|
42
|
+
@partial = partial
|
41
43
|
FileUtils.mkdir_p(@dir_path)
|
42
44
|
ObjectSpace.trace_object_allocations_start if @enable_tracing
|
43
45
|
|
@@ -46,7 +48,7 @@ module HeapProfiler
|
|
46
48
|
|
47
49
|
HeapProfiler.name_anonymous_modules!
|
48
50
|
|
49
|
-
|
51
|
+
GC.start
|
50
52
|
GC.disable
|
51
53
|
@generation = GC.count
|
52
54
|
end
|
@@ -60,11 +62,11 @@ module HeapProfiler
|
|
60
62
|
dump_heap(@allocated_heap)
|
61
63
|
|
62
64
|
GC.enable
|
63
|
-
|
64
|
-
dump_heap(@retained_heap, partial:
|
65
|
+
GC.start
|
66
|
+
dump_heap(@retained_heap, partial: @partial)
|
65
67
|
@allocated_heap.close
|
66
68
|
@retained_heap.close
|
67
|
-
write_info("generation", @generation.to_s)
|
69
|
+
write_info("generation", @partial ? @generation.to_s : "0")
|
68
70
|
end
|
69
71
|
|
70
72
|
def run
|
@@ -84,8 +84,10 @@ module HeapProfiler
|
|
84
84
|
analyzer = Analyzer.new(heap, index)
|
85
85
|
dimensions = analyzer.run(@metrics, @groupings)
|
86
86
|
|
87
|
-
|
88
|
-
|
87
|
+
if dimensions['total']
|
88
|
+
io.puts "Total: #{scale_bytes(dimensions['total'].memory)} " \
|
89
|
+
"(#{dimensions['total'].objects} objects)"
|
90
|
+
end
|
89
91
|
|
90
92
|
@metrics.each do |metric|
|
91
93
|
next unless GROUPED_METRICS.include?(metric)
|
@@ -13,10 +13,10 @@ module HeapProfiler
|
|
13
13
|
class << self
|
14
14
|
attr_accessor :current_reporter
|
15
15
|
|
16
|
-
def start(dir)
|
16
|
+
def start(dir, **kwargs)
|
17
17
|
return if current_reporter
|
18
18
|
self.current_reporter = Reporter.new(dir)
|
19
|
-
current_reporter.start
|
19
|
+
current_reporter.start(**kwargs)
|
20
20
|
end
|
21
21
|
|
22
22
|
def stop
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heap-profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Make several heap dumps and summarize allocated, retained memory
|
14
14
|
email:
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
- !ruby/object:Gem::Version
|
79
79
|
version: '0'
|
80
80
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
81
|
+
rubygems_version: 3.4.6
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Ruby heap profiling tool
|