Project

General

Profile

Actions

Bug #10244

closed

Garbage Collector not being triggered

Added by michel.boaventura (Michel Boaventura) about 10 years ago. Updated about 10 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
[ruby-core:65053]

Description

Hi all,

I'm trying to understand why this simple script doesn't trigger a single run of the GC and eats all memory:

require 'gdk3'

loop do
  Gdk::Pixbuf.new('foo.png')
end

Changing it just a little to print Ruby GC.stat[:count] shows a constant value always:

require 'gdk3'

i = 0
loop do
  i += 1
  Gdk::Pixbuf.new('foo.png')
  puts GC.stat[:count] if (i / 100).zero?
end

Moreover, if I manually run it, then the memory usage stays constant:

require 'gdk3'

loop do
  Gdk::Pixbuf.new('foo.png')
  GC.start
end

I understant that this is probably a gdk3 issue, but what is puzzling me is why GC isn't running automatically but if I start it manually everything works just fine.

Thank you!

Actions

Also available in: Atom PDF

Like0
Like0Like0