Comments (5)
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.
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.
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.
Hot or not, it doesn't matter if it doesn't occur now. Thanks.
from influxdb-ruby.
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)
- Count of results returned by query() is not equal to the number of queries passed HOT 11
- Example from README wrong about time-precision? HOT 8
- missing delete_measurement method HOT 3
- create or alter retention policy function not working for database containing hyphen '-' in database name HOT 4
- Travis/Ruby 2.2: Limit Rubygems version while updating
- Issue when writing a tag value ending in a back slash HOT 4
- Inconsistent number of points returned for each grouping HOT 2
- Tags data saved as values HOT 2
- NET::HTTP NoMethodError Exception: undefined method `include?' for nil:NilClass
- Flux queries HOT 1
- persistent connection HOT 1
- Deprecated use of 'DROP DATABASE foo' in a read only context, please use a POST request instead HOT 1
- create_database explodes HOT 2
- InfluxDB Beta is changing the default port from 9999 to 8086 in the next release
- Support Ruby 3.0
- query builder: "warning: too many arguments for format string"
- Support for gzip post requests
- "/" character in query gives error HOT 1
- Identify repo owner and move to InfluxCommunity org HOT 4
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 influxdb-ruby.