[#66678] [ruby-trunk - Feature #10481] Add "if" and "unless" clauses to rescue statements — alex@...
Issue #10481 has been updated by Alex Boyd.
3 messages
2014/12/04
[#66762] Re: [ruby-changes:36667] normal:r48748 (trunk): struct: avoid all O(n) behavior on access — Tanaka Akira <akr@...>
2014-12-10 0:44 GMT+09:00 normal <ko1@atdot.net>:
3 messages
2014/12/10
[#66851] [ruby-trunk - Feature #10585] struct: speedup struct.attr = v for first 10 attributes and struct[:attr] for big structs — funny.falcon@...
Issue #10585 has been updated by Yura Sokolov.
3 messages
2014/12/15
[#67126] Ruby 2.2.0 Released — "NARUSE, Yui" <naruse@...>
We are pleased to announce the release of Ruby 2.2.0.
8 messages
2014/12/25
[#67128] Re: Ruby 2.2.0 Released
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2014/12/25
I can't install it in any of our Ubuntu servers using rbenv:
[#67129] Re: Ruby 2.2.0 Released
— SHIBATA Hiroshi <shibata.hiroshi@...>
2014/12/25
> I can't install it in any of our Ubuntu servers using rbenv:
[ruby-core:66961] [ruby-trunk - Bug #10620] #define_singleton_method keeps object from being garbage collected
From:
normalperson@...
Date:
2014-12-19 01:18:37 UTC
List:
ruby-core #66961
Issue #10620 has been updated by Eric Wong.
Try the following infinite loop, I see stable memory usage:
loop do
obj = Object.new
obj.define_singleton_method(:f) { "F" }
end
Not even multiple calls to GC.start can guarantee an object is
collected, as the current Ruby GC is conservative and not precise.
Precise GC should solve the problem, but that is a lot of work
(and we'd still need a conservative part for 3rd party extensions
for years)
----------------------------------------
Bug #10620: #define_singleton_method keeps object from being garbage collected
https://bugs.ruby-lang.org/issues/10620#change-50498
* Author: Sean Dilda
* Status: Open
* Priority: Normal
* Assignee:
* Category: core
* Target version:
* ruby -v: 2.1.5
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
After using #define_singleton_method on an object, the object is never garbage collected
Sample code:
#!/usr/bin/env ruby
obj = Object.new
obj_id = obj.object_id
obj = nil
GC.start
GC.start
GC.start
GC.start
begin
ObjectSpace._id2ref obj_id
puts "GC failed, object still exists"
rescue RangeError
puts "GC worked"
end
obj = Object.new
obj.define_singleton_method(:f) { "F" }
obj_id = obj.object_id
obj = nil
GC.start
GC.start
GC.start
GC.start
begin
ObjectSpace._id2ref obj_id
puts "GC failed, object still exists"
rescue RangeError
puts "GC worked"
end
This outputted:
GC worked
GC failed, object still exists
The object without the singleton method was cleaned up properly, the object with defined_singleton_method used never got cleaned up.
--
https://bugs.ruby-lang.org/