More memory profiling

This commit is contained in:
Jaiden Mispy 2014-10-18 22:21:50 -07:00
parent b7f67ec0a6
commit 228e0caa65
7 changed files with 49 additions and 12 deletions

View file

@ -1,14 +1,14 @@
require 'spec_helper'
require 'memory_profiler'
def Process.rss; `ps -o rss= -p #{Process.pid}`.chomp.to_i; end
describe Ebooks::Model do
it "does not use a ridiculous amount of memory" do
RubyProf.start
Ebooks::Model.consume(path("data/0xabad1dea.json"))
result = RubyProf.stop
report = MemoryUsage.report do
model = Ebooks::Model.consume(path("data/0xabad1dea.json"))
end
require 'pry'; binding.pry
expect(report.total_retained).to be < 100000
expect(report.total_memsize).to be < 1000000000
end
end