Code Monkey home page Code Monkey logo

memprof's Introduction

NOTE

This project is no longer maintained. It does not work for any Ruby version above Ruby 1.8.7.

memprof

(c) Joe Damato @joedamato http://timetobleed.com

Memprof is a Ruby level memory profiler that can help you find reference leaks in your application.

Memprof can also do very lightweight function call tracing to figure out which system and library calls are happening in your code.

Installation

gem install memprof

API

Memprof.stats

Memprof.start
12.times{ "abc" }
Memprof.stats
Memprof.stop

Start tracking file/line information for objects created after calling Memprof.start, and print out a summary of file:line/class pairs created.

12 file.rb:2:String

Note: Call Memprof.stats again after GC.start to see which objects are cleaned up by the garbage collector:

Memprof.start
10.times{ $last_str = "abc" }

puts '=== Before GC'
Memprof.stats

puts '=== After GC'
GC.start
Memprof.stats

Memprof.stop

After GC.start, only the very last instance of "abc" will still exist:

=== Before GC
     10 file.rb:2:String
=== After GC
      1 file.rb:2:String

Note: Use Memprof.stats("/path/to/file") to write results to a file.

Note: Use Memprof.stats! to clear out tracking data after printing out results.

Memprof.track

Simple wrapper for Memprof.stats that will start/stop memprof around a given block of ruby code.

Memprof.track{
  100.times{ "abc" }
  100.times{ 1.23 + 1 }
  100.times{ Module.new }
}

For the block of ruby code, print out file:line/class pairs for ruby objects created.

100  file.rb:2:String
100  file.rb:3:Float
100  file.rb:4:Module

Note: You can call GC.start at the end of the block to print out only objects that are 'leaking' (i.e. objects that still have inbound references).

Note: Use Memprof.track("/path/to/file") to write the results to a file instead of stdout.

Memprof.dump

Memprof.dump{
  "hello" + "world"
}

Dump out all objects created in a given ruby block as detailed json objects.

{
  "_id": "0x15e5018",

  "file": "file.rb",
  "line": 2,

  "type": "string",
  "class_name": "String",

  "length": 10,
  "data": "helloworld"
}

Note: Use Memprof.dump("/path/to/filename") to write the json output to a file, one per line.

Memprof.dump_all

Memprof.dump_all("myapp_heap.json")

Dump out all live objects inside the Ruby VM to myapp_heap.json, one per line.

memprof.com heap visualizer

# load memprof before requiring rubygems, so objects created by
# rubygems itself are tracked by memprof too
require `gem which memprof/signal`.strip

require 'rubygems'
require 'myapp'

Installs a URG signal handler and starts tracking file/line information for newly created ruby objects. When the process receives SIGURG, it will fork and call Memprof.dump_all to write out the entire heap to a json file.

Use the memprof command to send the signal and upload the heap to memprof.com:

memprof --pid <PID> --name my_leaky_app --key <API_KEY>

Memprof.trace

require 'open-uri'
require 'mysql'
require 'memcached'

Memprof.trace{
  10.times{ Module.new }
  10.times{ GC.start }
  10.times{ open('http://google.com/') }
  10.times{ Mysql.connect.query("select 1+2") }
  10.times{ Memcached.new.get('memprof') }
}

For a given block of ruby code, count:

  • number of objects created per type
  • number of calls to and time spent in GC
  • number of calls to and time spent in connect/read/write/select
  • number of calls to and time spent in mysql queries
  • number of calls to and responses to memcached commands
  • number of calls to and bytes through malloc/realloc/free

The resulting json report looks like:

{
  "objects": {
    "created": 10,
    "types": {
      "module": 10,  # Module.new
    }
  },

  "gc": {
    "calls": 10,     # GC.start
    "time": 0.17198
  },

  "fd": {
    "connect": {
      "calls": 10,   # open('http://google.com')
      "time": 0.0110
    }
  },

  "mysql": {
    "queries": 10,   # Mysql.connect.query("select 1+2")
    "time": 0.0006
  },

  "memcache": {
    "get": {
      "calls": 10,   # Memcached.new.get('memprof')
      "responses": {
        "notfound": 10
      }
    }
  }
}

Note: To write json to a file instead, set Memprof.trace_filename = "/path/to/file.json"

Memprof.trace_request

Memprof.trace_request(env){ @app.call(env) }

Like Memprof.trace, but assume an incoming Rack request and include information about the request itself.

{
  "start" : 1272424769750716,
  "tracers" : {
    /* ... */
  },
  "rails" : {
    "controller" : "home",
    "action" : "index"
  },
  "request" : {
    "REQUEST_URI" : "/home",
    "REQUEST_METHOD" : "GET",
    "REMOTE_ADDR" : "127.0.0.1",
    "QUERY_STRING" : null
  },
  "time" : 1.3442
}

Middlewares

Memprof::Middleware

require 'memprof/middleware'
config.middlewares.use(Memprof::Middleware)

Wrap each request in a Memprof.track to print out all object location/type pairs created during that request.

Note: It is preferable to run this in staging or production mode with Rails applications, since development mode creates a lot of unnecessary objects during each request.

Note: To force a GC run before printing out a report, pass in :force_gc => true to the middleware.

Memprof::Tracer

require 'memprof/tracer'
config.middleware.insert(0, Memprof::Tracer)

Wrap each request in a Memprof.trace_request and write results to /tmp/memprof_tracer-PID.json

Memprof::Filter

Similar to Memprof::Tracer, but for legacy Rails 2.2 applications.

class ApplicationController < ActionController::Base
  require 'memprof/tracer'
  around_filter(Memprof::Filter)
end

Compatibility

Memprof supports all 1.8.x (MRI and REE) VMs, as long as they are 64-bit and contain debugging symbols. For best results, use RVM to compile ruby and make sure you are on a 64-bit machine.

The following ruby builds are not supported:

  • Ruby on small/medium EC2 instances (32-bit machines)
  • OSX's default system ruby (no debugging symbols, fat 32/64-bit binary)

Note: Many linux distributions do not package debugging symbols by default. You can usually install these separately, for example using apt-get install libruby1.8-dbg

Coming soon

  • support for Ruby 1.9
  • support for i386/i686 ruby builds

Credits

  • Jake Douglas for the Mach-O Snow Leopard support
  • Aman Gupta for various bug fixes and other cleanup
  • Rob Benson for initial 1.9 support and cleanup
  • Paul Barry for force_gc support in Memprof::Middleware

memprof's People

Contributors

careo avatar halorgium avatar ice799 avatar jakedouglas avatar pjb3 avatar tmm1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

memprof's Issues

Doesn't work on Ubuntu 10.10

Building native extensions. This could take a while...
ERROR: Error installing memprof:
ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
(I'm about to compile yajl.. this will definitely take a while)
-- tar zxvf yajl-1.0.9.tar.gz
-- sed -i -e 's,yajl,json,g' .h *.c api/.h
-- /usr/bin/ruby1.8 extconf.rb
-- make
-- ar rv libyajl_ext.a json_gen.o json_alloc.o json_parser.o json_encode.o json.o json_buf.o json_lex.o
checking for main() in -lyajl_ext... yes
checking for json/json_gen.h... yes
(I'm about to compile libelf.. this will definitely take a while)
-- tar zxvf libelf-0.8.13.tar.gz
-- ./configure --prefix=/home/jason/.rubygems/gems/memprof-0.3.6/ext/dst --disable-nls --disable-shared
-- make
-- make install
checking for gelf_getshdr() in -lelf_ext... yes
(I'm about to compile libdwarf.. this will definitely take a while)
-- tar zxvf libdwarf-20091118.tar.gz
-- ./configure
-- make
checking for main() in -ldwarf_ext... yes
checking for mach-o/dyld.h... no
creating Makefile

make
gcc -I. -I/home/jason/.rubygems/gems/memprof-0.3.6/ext/dst/include -I/home/jason/.rubygems/gems/memprof-0.3.6/ext/dst/include -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_JSON_JSON_GEN_H -DHAVE_ELF -DHAVE_DWARF -D_ARCH_i686_ -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -o util.o -c util.c
gcc -I. -I/home/jason/.rubygems/gems/memprof-0.3.6/ext/dst/include -I/home/jason/.rubygems/gems/memprof-0.3.6/ext/dst/include -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_JSON_JSON_GEN_H -DHAVE_ELF -DHAVE_DWARF -D_ARCH_i686_ -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -o i386.o -c i386.c
gcc -I. -I/home/jason/.rubygems/gems/memprof-0.3.6/ext/dst/include -I/home/jason/.rubygems/gems/memprof-0.3.6/ext/dst/include -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_JSON_JSON_GEN_H -DHAVE_ELF -DHAVE_DWARF -D_ARCH_i686_ -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -o x86_64.o -c x86_64.c
gcc -I. -I/home/jason/.rubygems/gems/memprof-0.3.6/ext/dst/include -I/home/jason/.rubygems/gems/memprof-0.3.6/ext/dst/include -I. -I/usr/lib/ruby/1.8/i686-linux -I. -DHAVE_JSON_JSON_GEN_H -DHAVE_ELF -DHAVE_DWARF -D_ARCH_i686_ -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -o elf.o -c elf.c
elf.c: In function ‘find_plt_addr’:
elf.c:368: warning: cast to pointer from integer of different size
elf.c: In function ‘dissect_elf’:
elf.c:1126: warning: cast to pointer from integer of different size
elf.c: In function ‘bin_init’:
elf.c:1217: error: duplicate case value
elf.c:1217: error: previously used here
elf.c:1218: error: duplicate case value
elf.c:1218: error: previously used here
make: *** [elf.o] Error 1

Gem files will remain installed in /home/jason/.rubygems/gems/memprof-0.3.6 for inspection.
Results logged to /home/jason/.rubygems/gems/memprof-0.3.6/ext/gem_make.out

32-bit version?

I was wondering if there was a real reason you did not release a 32 bit version, or is this a preference issue? I'm wondering if you have any plans in that direction.

Cheers, interesting work thus far

ruby: Failed to insert tramp for mysql_real_query with REE

I am running,


ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.4.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02

and memprof version 0.3.6 and I get error in the subject, thats all and mongrel quits. Is there anyway to print out more information about why memprof is failing there?

Memprof::Tracer fails with Assertion failed in json.c

good evening,

I have the following line in my production.rb:

require 'memprof/middleware'
config.middleware.insert(0, Memprof::Tracer)

Upon any request to my app, it partially renders then ends with this in stdout:

...
Completed 200 OK in 2315ms (Views: 1048.6ms | ActiveRecord: 885.7ms)
Assertion failed: (gen->state[gen->depth] == json_gen_complete), function json_gen_reset, file json.c, line 16.
Abort trap

No trace files are generated in tmp

Environment is:
REE/RVM: ruby 1.8.7 (2011-02-18 patchlevel 334) [i686-darwin10.7.0], MBARI 0x6770, Ruby Enterprise Edition 2011.03
Rails 3.0.5
Mac OS X 10.6.7

memprof does not get installed ubuntu (9.10)

$ gem install memprof Building native extensions. This could take a while... ERROR: Error installing memprof: ERROR: Failed to build gem native extension.

/usr/bin/ruby1.8 extconf.rb
checking for gelf_getshdr() in -lelf... no
checking for mach-o/dyld.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-elflib
--without-elflib

Gem files will remain installed in /home/anil/.gems/gems/memprof-0.1.2 for inspection.
Results logged to /home/anil/.gems/gems/memprof-0.1.2/ext/gem_make.out

Can't build with 1.8.7p330

I get this:


Users/gnufied/.rvm/rubies/ruby-1.8.7-p330/bin/ruby extconf.rb
checking for main() in -lyajl_ext... yes
checking for json/json_gen.h... yes
checking for mach-o/dyld.h... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include        --without-opt-include=${opt-dir}/include        --with-opt-lib        --without-opt-lib=${opt-dir}/lib        --with-make-prog        --without-make-prog        --srcdir=.        --curdir        --ruby=/Users/gnufied/.rvm/rubies/ruby-1.8.7-p330/bin/ruby
        --with-yajl_extlib
        --without-yajl_extlib
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/Users/gnufied/.rvm/rubies/ruby-1.8.7-p330/bin/ruby
        --with-yajl_extlib
        --without-yajl_extlib
extconf.rb:204: Unsupported platform: ["^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No struct type named heaps_slot.\"", "^error,msg=\"No symbol table is loa
ded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"",

ruby: getshstrndx() failed: no error.

ruby --version

ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2009.10

uname -a

Linux myhost 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

ruby -e "require 'memprof'"

ruby: getshstrndx() failed: no error.

ruby: Failed to insert tramp for connect

When I try to use Memprof.trace { ... }, I get the error:

ruby: Failed to insert tramp for connect

Which I cannot seem to find on Google. Frustrating.

Memprof.trace("gsolr_track.json") {
  iters.times {
    @gsolr = GSolr.connect(:url => url)
  }

  iters.times {
    @gsolr.request("/select", :q => query)
  }
}

trouble installing memprof for profiling a legacy ree app

I'm getting the following while trying to install memprof gem

Installing gem memprof-0.3.10
/home/divya/.rvm/gems/ree-1.8.7-2012.02/gems/memprof-0.3.10/.gitignore
....
....
/home/divya/.rvm/gems/ree-1.8.7-2012.02/gems/memprof-0.3.10/spec/tracing_spec.rb
Building native extensions.  This could take a while...
ERROR:  Error installing memprof:
    ERROR: Failed to build gem native extension.

        /home/divya/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb
(I'm about to compile yajl.. this will definitely take a while)
  -- tar zxvf yajl-1.0.9.tar.gz
  -- sed -i -e 's,yajl,json,g' *.h *.c api/*.h
  -- /home/divya/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/home/divya/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby
extconf.rb:17:in `sys': /home/divya/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb failed, please report to [email protected] with pastie.org link to /home/divya/.rvm/gems/ree-1.8.7-2012.02/gems/memprof-0.3.10/ext/mkmf.log (RuntimeError)
    from extconf.rb:50
    from extconf.rb:35:in `chdir'
    from extconf.rb:35
    from extconf.rb:31:in `chdir'
    from extconf.rb:31


Gem files will remain installed in /home/divya/.rvm/gems/ree-1.8.7-2012.02/gems/memprof-0.3.10 for inspection.
Results logged to /home/divya/.rvm/gems/ree-1.8.7-2012.02/gems/memprof-0.3.10/ext/gem_make.out

I don't see '/home/divya/.rvm/gems/ree-1.8.7-2012.02/gems/memprof-0.3.10/ext/mkmf.log' file.

'/home/divya/.rvm/gems/ree-1.8.7-2012.02/gems/memprof-0.3.10/ext/src/mkmf.log' ends with the following 2 lines after yajl gets extracted.

"sed -i -e 's,yajl,json,g' *.h *.c api/*.h"
"/home/divya/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby extconf.rb"
/home/divya/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby: no such file to load -- ./siteconf20140529-5820-s957to-0.rb (LoadError)

The file siteconf20140529-5820-s957to-0.rb is present in '/home/divya/.rvm/gems/ree-1.8.7-2012.02/gems/memprof-0.3.10/ext'

If i goto '/home/divya/.rvm/gems/ree-1.8.7-2012.02/gems/memprof-0.3.10/ext/src/yajl-1.0.9/src' and run ruby extconf.rb , it generates the Makefile and make runs properly and yajl is built

have a 32bit os installed on a 64bit cpu

created this issue as i had a confusion what a 32bit system means, if i have a 64bit compliant cpu but i have a 32bit os, can i still install memprof.

I have a 32bit os (ubuntu 9.10) installed on a 64bit cpu (intel core2 duo)

uname -a
Linux o 2.6.31-22-generic #60-Ubuntu SMP Thu May 27 00:22:23 UTC 2010 i686 GNU/Linux

/proc/cpuinfo (info truncated)
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T6670 @ 2.20GHz
cpuid level : 13
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm ida tpr_shadow vnmi flexpriority

the full stack trace is here:
http://gist.github.com/500003

Memprof.trace produces 0 object counts

Using Memprof.trace, the object count appears to be zero.. Other stats work, it seems.

$ ruby -v
ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01
$ gem list memprof

*** LOCAL GEMS ***

memprof (0.3.6)
$ irb
irb(main):001:0> a = []
=> []
irb(main):002:0> Memprof.trace{ 10.times { a<<Object.new } }
{
  "memcache": {

  },
  "mysql": {

  },
  "fd": {

  },
  "objects": {
    "created": 0,
    "types": {

    }
  },
  "gc": {
    "calls": 0,
    "time": 0
  },
  "memory": {

  }
}

=> 10
irb(main):003:0> a
=> [#<Object:0x1ca7898>, #<Object:0x1ca7870>, #<Object:0x1ca7848>, #<Object:0x1ca7820>, #<Object:0x1ca77f8>, #<Object:0x1ca77d0>, #<Object:0x1ca77a8>, #<Object:0x1ca7780>, #<Object:0x1ca7758>, #<Object:0x1ca7730>]

Middlewares don't work

I tried Memprof::Middleware and Memprof::Tracer, but both produced extremely peculiar results. I kind of expected them to dump json stuff to a log or to different log files, or at least a list similar to Memprof.stats right there in the console. But instead, after each request, it seemed like they were printing backtraces, but no errors.

I'll send you an example if you like, but won't include it here as it's extremely extremely lengthy.

License?

What license is this released under? Sorry if it's in an obvious place and I'm just missing it.

Is this project dead?

Seems like getting the gem to work has been a challenge and a lot of people are having problems, so I'm wondering if there are plans to continue working on this?

Thanks

Symbol not found: __mh_bundle_header

OS X 10.7.2, MRI 1.8.7-p249 via RVM, everything compiled with GCC 4.2, require "memprof" produces:

LoadError: dlopen(/Users/john/.rvm/gems/ruby-1.8.7-p249/gems/memprof-0.3.10/lib/memprof.bundle, 9): Symbol not found: __mh_bundle_header
  Referenced from: /Users/john/.rvm/gems/ruby-1.8.7-p249/gems/memprof-0.3.10/lib/memprof.bundle
  Expected in: flat namespace
 in /Users/john/.rvm/gems/ruby-1.8.7-p249/gems/memprof-0.3.10/lib/memprof.bundle - /Users/john/.rvm/gems/ruby-1.8.7-p249/gems/memprof-0.3.10/lib/memprof.bundle
    from /Users/john/.rvm/gems/ruby-1.8.7-p249/gems/memprof-0.3.10/lib/memprof.bundle
    from /Users/john/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:59:in `require'
    from (irb):6

I followed the advice of this SO answer to get it to work.

memprof got installed but fails with segmentation fault

memprof got installed.

uname -a
Linux foo-xen #1 SMP Mon Jan 26 03:09:12 UTC 2009 x86_64 GNU/Linux

But, i am getting "Segmentation fault" when i run the example from the README

ruby foo.rb
foo.rb:5: [BUG] Segmentation fault
ruby 1.8.7 (2010-04-19 patchlevel 253) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.02
Aborted

CODE:
require 'rubygems'
require 'memprof'
Memprof.track {
100.times{ "abc" }
100.times{ 1.23 + 1 }
100.times{ Module.new }
}

Error when calling dump_all

I've been using memprof with my project, specifically the stats and dump methods. They work perfectly. However, when I attempt to use the dump_all method, I get this:

<Memprof::Unsupported: not enough config data to dump heap>

Can you tell me if this is a bug or if there is some configuration I need to do?

I'm running REE 1.8.7 2011.03

Thanks,
Eric

does not install on OS X 10.6.4

sudo gem install memprof
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing memprof:
  ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for main() in -lyajl_ext... yes
checking for json/json_gen.h... yes
checking for mach-o/dyld.h... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  --with-yajl_extlib
  --without-yajl_extlib
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
  --with-yajl_extlib
  --without-yajl_extlib
extconf.rb:204: Unsupported platform: ["^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No struct type named heaps_slot.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\"", "^error,msg=\"No symbol table is loaded.  Use the \\\"file\\\" command.\""] (RuntimeError)


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/memprof-0.3.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/memprof-0.3.5/ext/gem_make.out

Line numbers are doubled

   2243 /home/onespot/editor-ui/releases/20100223210117/lib/shared/ruby_ext.rb:646:String
    358 /home/onespot/editor-ui/releases/20100223210117/app/models/word_frequency.rb:84:String
    155 /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/activesupport-2.1.2/lib/active_support/multibyte/handlers/utf8_handler.rb:768:Array
    119 /home/onespot/editor-ui/releases/20100223210117/app/models/word_frequency.rb:62:String
     48 /home/onespot/editor-ui/releases/20100223210117/app/models/word_frequency.rb:94:String

All of these line numbers are exactly 2x the actual line number in the source. I assume there's a bitshift bug somewhere. The first one is actually line 323, e.g.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.