perf: task template to measure memory leaks
This commit is contained in:
parent
f2bc88d5c0
commit
b8fdbff110
1 changed files with 11 additions and 0 deletions
|
@ -131,4 +131,15 @@ namespace :benchmarks do
|
||||||
x.compare!
|
x.compare!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
desc "Inspect possible memory leaks"
|
||||||
|
task inspect_memory_leak: :environment do
|
||||||
|
10.times do
|
||||||
|
10_000.times do
|
||||||
|
# Write code here
|
||||||
|
end
|
||||||
|
|
||||||
|
puts `ps -o rss= -p #{$$}`
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue