memory_profiler 0.9.11 → 0.9.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/memory_profiler/helpers.rb +1 -1
- data/lib/memory_profiler/reporter.rb +7 -1
- data/lib/memory_profiler/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 144e3c662a07ad7303cd60990d43aef9c050028689fbfef285e8eadd8a161b78
|
4
|
+
data.tar.gz: c24f4ed76fc71ee0fb17b9edf5f2d46b621aeb443a2006cd34c2eddad7ddb101
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5a9469d8ef19bace4028033dbee40b62aad465933eb8f393f1f1e3ea72f0ac88a390b20412e4f3edbae333c12a1ab75d8b63669d5fddf09fe79cab7c5261f16
|
7
|
+
data.tar.gz: dbad24a4cad1d5ef4adaac6ed89cd79695cd23d2fde7eb0e45d8bcb3b3193da5fefd24a10aa8f9653fa74f94d33602379b023b94dd97d544ecfaea5b799d5fc1
|
data/CHANGELOG.md
CHANGED
@@ -35,7 +35,7 @@ module MemoryProfiler
|
|
35
35
|
# This string is shortened to 200 characters which is what the string report shows
|
36
36
|
# The string report can still list unique strings longer than 200 characters
|
37
37
|
# separately because the object_id of the shortened string will be different
|
38
|
-
@string_cache[obj] ||= obj[0,200]
|
38
|
+
@string_cache[obj] ||= String.new << obj[0,200]
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
@@ -32,6 +32,8 @@ module MemoryProfiler
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def start
|
35
|
+
GC.start
|
36
|
+
GC.start
|
35
37
|
GC.start
|
36
38
|
GC.disable
|
37
39
|
|
@@ -46,6 +48,8 @@ module MemoryProfiler
|
|
46
48
|
|
47
49
|
GC.enable
|
48
50
|
GC.start
|
51
|
+
GC.start
|
52
|
+
GC.start
|
49
53
|
|
50
54
|
# Caution: Do not allocate any new Objects between the call to GC.start and the completion of the retained
|
51
55
|
# lookups. It is likely that a new Object would reuse an object_id from a GC'd object.
|
@@ -107,9 +111,11 @@ module MemoryProfiler
|
|
107
111
|
class_name = helper.lookup_class_name(klass)
|
108
112
|
gem = helper.guess_gem(file)
|
109
113
|
|
114
|
+
# we do memsize first to avoid freezing as a side effect and shifting
|
115
|
+
# storage to the new frozen string, this happens on @hash[s] in lookup_string
|
116
|
+
memsize = ObjectSpace.memsize_of(obj) + rvalue_size_adjustment
|
110
117
|
string = klass == String ? helper.lookup_string(obj) : nil
|
111
118
|
|
112
|
-
memsize = ObjectSpace.memsize_of(obj) + rvalue_size_adjustment
|
113
119
|
# compensate for API bug
|
114
120
|
memsize = rvalue_size if memsize > 100_000_000_000
|
115
121
|
result[obj.__id__] = MemoryProfiler::Stat.new(class_name, gem, file, location, memsize, string)
|
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Memory profiling routines for Ruby 2.1+
|
14
14
|
email:
|