GithubHelp home page GithubHelp logo

Comments (5)

dgutov avatar dgutov commented on August 19, 2024

For some evidence:

require 'influxdb'
require 'memory_profiler'
MemoryProfiler.report { InfluxDB::Client.new }.pretty_print

=>

...
retained memory by class
-----------------------------------
       232  InfluxDB::Config
        80  Proc
        76  Thread::Queue
        40  Hash
        40  InfluxDB::Client

retained objects by gem
-----------------------------------
         3  influxdb-0.8.1
         2  other

retained objects by file
-----------------------------------
         2  (irb)
         2  /home/dgutov/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/influxdb-0.8.1/lib/influxdb/client.rb
         1  /home/dgutov/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/influxdb-0.8.1/lib/influxdb/config.rb

retained objects by location
-----------------------------------
         2  (irb):5
         1  /home/dgutov/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/influxdb-0.8.1/lib/influxdb/client.rb:54
         1  /home/dgutov/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/influxdb-0.8.1/lib/influxdb/client.rb:58
         1  /home/dgutov/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/influxdb-0.8.1/lib/influxdb/config.rb:130

retained objects by class
-----------------------------------
         1  Hash
         1  InfluxDB::Client
         1  InfluxDB::Config
         1  Proc
         1  Thread::Queue

from influxdb-ruby.

hogaur avatar hogaur commented on August 19, 2024

Thanks for reporting this issue. Have you looked into it further? I assume it is a hot issue and lies on the critical path.

from influxdb-ruby.

dgutov avatar dgutov commented on August 19, 2024

It wasn't that hot, but if the client is instantiated again and again, that did contribute to unbounded memory growth.

We ultimately went with either with a pool or with a global client instance. I can't remember which of these two, sorry.

from influxdb-ruby.

hogaur avatar hogaur commented on August 19, 2024

Hot or not, it doesn't matter if it doesn't occur now. Thanks.

from influxdb-ruby.

dgutov avatar dgutov commented on August 19, 2024

It does occur. Be careful not to instantiate a new instance of InfluxDb::Client in your web request handlers.

from influxdb-ruby.

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.