heapy 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/check_changelog.yml +13 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +8 -0
- data/README.md +38 -4
- data/bin/heapy +1 -2
- data/heapy.gemspec +4 -4
- data/lib/heapy.rb +90 -55
- data/lib/heapy/analyzer.rb +15 -6
- data/lib/heapy/diff.rb +105 -0
- data/lib/heapy/version.rb +1 -1
- metadata +30 -35
- data/lib/heapy/alive.rb +0 -269
- data/scratch.rb +0 -64
- data/weird_memory/run.rb +0 -31
- data/weird_memory/singleton_class/singleton_class.rb +0 -26
- data/weird_memory/singleton_class/singleton_class_in_class.rb +0 -29
- data/weird_memory/singleton_class/singleton_class_in_proc.rb +0 -28
- data/weird_memory/singleton_class/singleton_class_method_in_proc.rb +0 -26
- data/weird_memory/singleton_class_instance_eval/singleton_class_instance_eval.rb +0 -27
- data/weird_memory/singleton_class_instance_eval/singleton_class_instance_eval_in_class.rb +0 -29
- data/weird_memory/singleton_class_instance_eval/singleton_class_instance_eval_in_proc.rb +0 -29
- data/weird_memory/singleton_class_instance_eval/singleton_class_instance_eval_method_in_proc.rb +0 -27
- data/weird_memory/string/string.rb +0 -25
- data/weird_memory/string/string_in_class.rb +0 -27
- data/weird_memory/string/string_in_proc.rb +0 -26
- data/weird_memory/string/string_method_in_proc.rb +0 -25
- data/weird_memory/times_map/times_map.rb +0 -28
- data/weird_memory/times_map/times_map_in_class.rb +0 -29
- data/weird_memory/times_map/times_map_in_proc.rb +0 -30
- data/weird_memory/times_map/times_map_method_in_proc.rb +0 -29
@@ -1,29 +0,0 @@
|
|
1
|
-
$LOAD_PATH.unshift(File.expand_path(File.join(__FILE__, "../../../lib")))
|
2
|
-
|
3
|
-
require 'heapy'
|
4
|
-
|
5
|
-
|
6
|
-
Heapy::Alive.start_object_trace!(heap_file: ENV.fetch('HEAP_FILE') { 'tmp/heap.json' })
|
7
|
-
|
8
|
-
def run
|
9
|
-
array = 1.times.map {
|
10
|
-
string = ""
|
11
|
-
Heapy::Alive.trace_without_retain(string)
|
12
|
-
string
|
13
|
-
}
|
14
|
-
array = nil
|
15
|
-
return nil
|
16
|
-
end
|
17
|
-
|
18
|
-
-> { run }.call
|
19
|
-
|
20
|
-
alive_count = Heapy::Alive.traced_objects.select {|tracer|
|
21
|
-
tracer.object_retained?
|
22
|
-
}.length
|
23
|
-
# should return 0, no traced objects are returned
|
24
|
-
|
25
|
-
|
26
|
-
expected = 0
|
27
|
-
actual = alive_count
|
28
|
-
result = expected == actual ? "PASS" : "FAIL"
|
29
|
-
puts "#{result}: expected: #{expected}, actual: #{actual}"
|