Giter Club home page Giter Club logo

Comments (6)

morellon avatar morellon commented on August 30, 2024

I thought ffi would take care of memory management for me. I will take a look more carefully on how ffi does it. I may need to manualy free some pointers (through ffi) used on the bindings or even using librrd memory management (rrd_freemem and rrd_info_free C functions) it self.

Thanks for the feedback. I will also make a deamon running the same methods you are using and try the solutions above. I think a destroy! should be the last resource, as the gem should work transparently to the end user.
I will get in touch as soon as possible.

Thanks!

from rrd-ffi.

renchap avatar renchap commented on August 30, 2024

If this is useful :
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.2.0]
The webserver used is Thin. Webrick (using rails server from rails 3) crashes when i call rrd-ffi, dont know how to troubleshoot this)

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

Can you test again from source? I think i've fixed it.

from rrd-ffi.

renchap avatar renchap commented on August 30, 2024

I dont think its fixed.
Here are the top results :

PID    COMMAND      %CPU TIME     #TH  #WQ  #POR #MRE RPRV RSHRD  RSIZ VPRV VSIZE  PGRP  PPID  STATE    UID
94807  ruby         5.7  00:06.99 2    0    36   213  71M  2456K  75M  84M  2464M  94807 94186 sleeping 501

PID    COMMAND      %CPU TIME     #TH  #WQ  #POR #MRE RPRVT RSHRD  RSIZE VPRVT VSIZE  PGRP  PPID  STATE    UID
94807  ruby         8.5  00:39.55 2/1  0    36   291  197M+ 2456K  201M+ 208M  2588M  94807 94186 running  501

There was a little more than 30s between two, with 1 call to my controller each second.

I bumbed the gemspec to 0.2.2, built and installed the gem, and checked bundler if all was right :
$ bundle show
Gems included by the bundle:
...

  • rrd-ffi (0.2.2)

If you want to try, my code is here : http://github.com/renchap/graphs-on-rails
You will need a simple collectd install (with memory or cpu plugins) to have some rrd files. You can accelerate the polling by changing http://github.com/renchap/graphs-on-rails/blob/master/app/views/metrics/show.html.haml#L36

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

renchap,

which version of rrdtool are you using? if it is 1.3.x try upgrading to 1.4.2

i tested with the code in examples/all.rb and i couldn't find a memory leak for both fetch and info on 1.4.2 using darwin10.2.0 and ruby 1.8.7/1.9.2.preview1

from rrd-ffi.

morellon avatar morellon commented on August 30, 2024

I will close it, please reopen if the issues reappears

from rrd-ffi.

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.