Project

General

Profile

Actions

Bug #1392

closed

Object#extend leaks memory on Ruby 1.9.1

Added by oldmoe (Muhammad Ali) almost 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i686-linux]
Backport:

Description

=begin
A few bytes are leaked every time Object#extend is called, here is a sample 1.9.1 script

This code is Ruby 1.9.x and above only

@extend = ARGV[0]

module BetterHash
def blabla
end
end

unless @extend
class Hash
include BetterHash
end
end

t = Time.now
1_000_000.times do
s = {}
s.extend BetterHash if @extend
end
after = Time.now - t
puts "done with #{GC.count} gc runs after #{after} seconds"
sleep # so that it doesn't exit before we check the memory

more details here :

http://oldmoe.blogspot.com/2009/04/objectextend-leaks-memory-on-ruby-191.html

oldmoe
=end


Files

free_eclass.patch (293 Bytes) free_eclass.patch wanabe (_ wanabe), 01/29/2010 05:44 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0