-
-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memory leak with timers #770
Comments
actually seems this is not about timers, this leak also (1Gb in 5 hours): require 'bundler/setup'
require 'celluloid'
class A
include Celluloid
def initialize
end
def stop
terminate
end
end
p Celluloid::VERSION
p Timers::VERSION
loop do
actors = Array.new(50) { A.new }
sleep 10.0
actors.each &:stop
end |
FWIW, I am also seeing similar but not entirely identical behavior with Celluloid Notifications. Only on JRuby, works fine on MRI. The script below will use up about 4 GiB in 5 minutes. Some of this will be reclaimed on GC, but even so, there is still an unreasonably large amount of memory being retained. require 'bundler/setup'
require 'celluloid'
require 'celluloid/autostart'
class Subscriber
include Celluloid
include Celluloid::Notifications
def initialize
subscribe('errors', :error)
puts 'Subscriber initialized'
end
def error(topic, data)
#puts 'got it'
end
end
class Publisher
extend Celluloid::Notifications
def self.publish_message(error)
publish(
'errors',
error: error
)
end
end
p Celluloid::VERSION
subscriber = Subscriber.new
loop do
Publisher.publish_message('dummy error')
end Are we using Celluloid Notifications in the completely wrong way or is there indeed a bug in Celluloid/JRuby here? (A longer writeup about how I landed here: http://perlun.eu.org/en/2018/06/28/jruby-memory-leak-in-production) |
this program eats 2Gb in 10 hours. i think this related somehow to gem timers (also there was a leak in it before #455). ruby 2.4.1p111, celluloid: "0.17.3", timers: "4.1.2", Ubuntu 12.04.1 LTS
The text was updated successfully, but these errors were encountered: