Comments (6)
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.
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.
Can you test again from source? I think i've fixed it.
from rrd-ffi.
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.
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.
I will close it, please reopen if the issues reappears
from rrd-ffi.
Related Issues (20)
- I18n dependency HOT 1
- Dependency problem with ActiveSupport > 3.0.9? HOT 2
- Variable as datasource name HOT 3
- :start not working? HOT 4
- Stack graph HOT 2
- SyntaxError: rrd.rb:47 during require HOT 13
- Undefined constant RRD_FILE in example HOT 1
- Option for using wrapper bang methods HOT 3
- RRD::Wrapper.graph PRINTs HOT 4
- generating graph sometimes loops glib on OSX 10.7.5 HOT 10
- add HRULE
- Exception: FFI::NotFoundError when rrdtool was compiled without graphics support
- Add support for "--daemon" option
- RRD::Base#fetch returns different values in the "time" column than 'rrdtool fetch' HOT 1
- Fetching data from a rrd HOT 2
- Support for rrdtool 1.6? HOT 1
- Opening an existing RRD HOT 3
- RRD database Archive with 1 year problem real number HOT 2
- Segfault on wrapper.rb:121 get_array_of_string HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rrd-ffi.