memprof2 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +2 -1
- data/CHANGELOG.md +6 -0
- data/README.md +4 -0
- data/lib/memprof2.rb +9 -1
- data/memprof2.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 872a5c02d0caafb72b915f3ca479cdf2645257e5
|
4
|
+
data.tar.gz: 8b77e75719e02f98820e72b3e87912eedf048a77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff43e44e94c77894d74dd75adb759612201a0728332ef39a0cb4fb5469a428322e0e4c9eecfba0901e8582fd74cf609a947dc98f2f781f1211935387f9a37d8a
|
7
|
+
data.tar.gz: c48dc094f0ffec7cb362c7111b894814a0da4e4a8b33bc1bad1d9c3ad8f8b0e1e403e566f36b638ebb72f3f069c7fe624d1f2753df188fc5ae12dd5bfb69bf18
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -95,6 +95,10 @@ For the block of ruby code, print out file:line:class pairs for ruby objects cre
|
|
95
95
|
|
96
96
|
See [CHANGELOG.md](CHANGELOG.md) for details.
|
97
97
|
|
98
|
+
## See Also
|
99
|
+
|
100
|
+
* [Ruby でラインメモリプロファイラ](http://qiita.com/sonots/items/c14b3e3ca8e6f7dfb651) (Japanese)
|
101
|
+
|
98
102
|
## Contributing
|
99
103
|
|
100
104
|
1. Fork it
|
data/lib/memprof2.rb
CHANGED
@@ -58,7 +58,15 @@ class Memprof2
|
|
58
58
|
next if (@trace and @trace !~ file)
|
59
59
|
next if (@ignore and @ignore =~ file)
|
60
60
|
line = ObjectSpace.allocation_sourceline(o)
|
61
|
-
|
61
|
+
if RUBY_VERSION >= "2.2.0"
|
62
|
+
# Ruby 2.2.0 takes into account sizeof(RVALUE)
|
63
|
+
# https://bugs.ruby-lang.org/issues/8984
|
64
|
+
memsize = ObjectSpace.memsize_of(o)
|
65
|
+
else
|
66
|
+
# Ruby < 2.2.0 does not have ways to get memsize correctly, but let me make a bid as much as possible
|
67
|
+
# https://twitter.com/sonots/status/544334978515869698
|
68
|
+
memsize = ObjectSpace.memsize_of(o) + @rvalue_size
|
69
|
+
end
|
62
70
|
memsize = @rvalue_size if memsize > 100_000_000_000 # compensate for API bug
|
63
71
|
klass = o.class.name rescue "BasicObject"
|
64
72
|
location = "#{file}:#{line}:#{klass}"
|
data/memprof2.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memprof2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
78
|
version: '0'
|
79
79
|
requirements: []
|
80
80
|
rubyforge_project:
|
81
|
-
rubygems_version: 2.
|
81
|
+
rubygems_version: 2.4.5
|
82
82
|
signing_key:
|
83
83
|
specification_version: 4
|
84
84
|
summary: Ruby memory profiler for >= Ruby 2.1.0
|