Question

From reading the doc https://github.com/ruby-prof/ruby-prof:

It seems that some patches were originally required for these features,

for allocations: http://rubyforge.org/tracker/index.php?func=detail&aid=11497&group_id=426&atid=1700

for memory use: http://rubyforge.org/tracker/index.php?func=detail&aid=17676&group_id=1814&atid=7062

The latter of which claims to have been applied.

This github issue seems to back that up: https://github.com/ruby-prof/ruby-prof/issues/86

But I have had absolutely no luck getting either of these modes to work in a 2.1.1 install, eg:

require 'ruby-prof'

RubyProf.measure_mode = RubyProf::MEMORY
RubyProf.start
  1000.times do
    s = "string"
  end
RubyProf::FlatPrinter.new(RubyProf.stop).print

Produces:

Thread ID: 4183000
Fiber ID: 8413080
Total: 0.000000
Sort by: self_time

 %self      total      self      wait     child     calls  name
   NaN      0.000     0.000     0.000     0.000        1   Integer#times 
   NaN      0.000     0.000     0.000     0.000        1   Global#[No method]

I even went so far as to try install ruby 1.9.3 to do this profiling, but rvm seems unable to find any of the old patches. Is there some way to get this working? or have these features been abandoned?

Was it helpful?

Solution

According to a ruby-prof issue we need a patched version of ruby to use the memory profiler.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top