Code Monkey home page Code Monkey logo

Comments (6)

tmm1 avatar tmm1 commented on July 28, 2024

Strange. Do the GC stats work?

Memprof.trace{ 10.times{ GC.start } }

Can you also include the output of memprof --info

from memprof.

ghazel avatar ghazel commented on July 28, 2024
$memprof --info
Memprof Uploader
http://www.memprof.com
======================

ruby 1.8.7 (2009-12-24 patchlevel 248) [x86_64-linux], MBARI 0x6770, Ruby Enterprise Edition 2010.01
CFLAGS='-g -O2   ' ./configure  '--prefix=/usr/local/ruby-enterprise-1.8.7-2010.01' '--enable-mbari-api' 'CFLAGS=-g -O2 '
/usr/local/ruby-enterprise-1.8.7-2010.01/bin/ruby: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
        libtcmalloc_minimal.so.0 => /usr/local/ruby-enterprise-1.8.7-2010.01/lib/libtcmalloc_minimal.so.0 (0x00002aaaaacc8000)
        librt.so.1 => /lib64/librt.so.1 (0x00002aaaaaf1a000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00002aaaab123000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002aaaab328000)
        libm.so.6 => /lib64/libm.so.6 (0x00002aaaab560000)
        libc.so.6 => /lib64/libc.so.6 (0x00002aaaab7e3000)
        libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002aaaabb3b000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aaaabe3b000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaac049000)
        /lib64/ld-linux-x86-64.so.2 (0x00002aaaaaaab000)

from memprof.

ghazel avatar ghazel commented on July 28, 2024

Sorry, missed your first question:

irb(main):002:0> Memprof.trace{ 10.times{ GC.start } }
{
  "memcache": {

  },
  "mysql": {

  },
  "fd": {

  },
  "objects": {
    "created": 11,
    "types": {
      "varmap": 11
    }
  },
  "gc": {
    "calls": 10,
    "time": 0.092604
  },
  "memory": {
    "free": {
      "calls": 85413,
      "actual": 7756144
    }
  }
}

from memprof.

tmm1 avatar tmm1 commented on July 28, 2024

It is not currently possible to use the memprof tracer along with other memprof features in the same process. If you call Memprof.start or include any of the middlewares, the Memprof.trace object tracer will not work.

Try running:

ruby -rubygems -e' require "memprof"; Memprof.trace{ 10.times{Object.new} } '

This works for me locally, whereas:

ruby -rubygems -e' require "memprof"; Memprof.start; Memprof.trace{ 10.times{Object.new} } '

shows 0 counts for objects created. This is because Memprof.start installs its own hooks into new object creation, causing issues with the tracer later on.

from memprof.

ghazel avatar ghazel commented on July 28, 2024

Hm. I don't think I was doing that, but then as you can see from the GC output I pasted, object counts are working now, as is the example I was trying when I first reported it... So, that's strange.

Oh well. I'll re-open this if it happens again.

from memprof.

ghazel avatar ghazel commented on July 28, 2024

Ah, no, you're right. Scrollback shows I had done a Memprof.start before that. Good catch!

Maybe a warning / error would be helpful in the future?

from memprof.

Related Issues (20)

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.