memory_profiler 0.9.3 → 0.9.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/memory_profiler/reporter.rb +2 -1
- data/lib/memory_profiler/results.rb +6 -2
- data/lib/memory_profiler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 841f12f37a8d6ee73594fc0e9ab8718a1d79fb01
|
4
|
+
data.tar.gz: ecb6925b365225274bfca91f11161d9dd83cd5d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87d5d6cb856bf78f196edef91c06d04ab8ad239d2c124cb1233ceeb90e8363a0deaccfd1a00d10ad68290e84b008ae83e9312fbb6b6a89d1fe433edb7aeb72b5
|
7
|
+
data.tar.gz: 68125449269c55e6f9e18299ba43bd4d743eb3f5a3e49558b7d7ef2b339a8942355678480ee52f40d72d74512cb347c5bad17ff9fd1f81d357f19ee4d10cb9f9
|
data/README.md
CHANGED
@@ -366,6 +366,10 @@ Memory profiler also performs some String analysis to help you find strings that
|
|
366
366
|
|
367
367
|
## Changelog
|
368
368
|
|
369
|
+
### 0.9.4
|
370
|
+
- FIX: remove incorrect RVALUE offset on 2.2 @dgynn
|
371
|
+
- FEATURE: add total memory usage @dgynn
|
372
|
+
|
369
373
|
### 0.9.3
|
370
374
|
- Add class reporting
|
371
375
|
|
@@ -109,7 +109,8 @@ module MemoryProfiler
|
|
109
109
|
begin
|
110
110
|
object_id = obj.__id__
|
111
111
|
|
112
|
-
memsize = ObjectSpace.memsize_of(obj)
|
112
|
+
memsize = ObjectSpace.memsize_of(obj)
|
113
|
+
memsize += rvalue_size if RUBY_VERSION < '2.2'.freeze
|
113
114
|
# compensate for API bug
|
114
115
|
memsize = rvalue_size if memsize > 100_000_000_000
|
115
116
|
results[object_id] = Stat.new(class_name, file, line, class_path, method_id, memsize)
|
@@ -38,6 +38,7 @@ module MemoryProfiler
|
|
38
38
|
|
39
39
|
attr_accessor :strings_retained, :strings_allocated
|
40
40
|
attr_accessor :total_retained, :total_allocated
|
41
|
+
attr_accessor :total_retained_memsize, :total_allocated_memsize
|
41
42
|
|
42
43
|
def self.from_raw(allocated, retained, top)
|
43
44
|
self.new.register_results(allocated, retained, top)
|
@@ -62,7 +63,9 @@ module MemoryProfiler
|
|
62
63
|
self.strings_retained = string_report(retained, top)
|
63
64
|
|
64
65
|
self.total_allocated = allocated.count
|
66
|
+
self.total_allocated_memsize = allocated.values.map(&:memsize).inject(:+) || 0
|
65
67
|
self.total_retained = retained.count
|
68
|
+
self.total_retained_memsize = retained.values.map(&:memsize).inject(:+) || 0
|
66
69
|
|
67
70
|
self
|
68
71
|
end
|
@@ -86,8 +89,9 @@ module MemoryProfiler
|
|
86
89
|
color_output = options.fetch(:color_output) { io.respond_to?(:isatty) && io.isatty }
|
87
90
|
@colorize = color_output ? Polychrome.new : Monochrome.new
|
88
91
|
|
89
|
-
io.puts "Total allocated #{total_allocated}"
|
90
|
-
io.puts "Total retained #{total_retained}"
|
92
|
+
io.puts "Total allocated: #{total_allocated_memsize} bytes (#{total_allocated} objects)"
|
93
|
+
io.puts "Total retained: #{total_retained_memsize} bytes (#{total_retained} objects)"
|
94
|
+
|
91
95
|
io.puts
|
92
96
|
["allocated", "retained"]
|
93
97
|
.product(["memory", "objects"])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memory_profiler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|