[#88925] [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical — ko1@...
Issue #15095 has been updated by ko1 (Koichi Sasada).
4 messages
2018/09/09
[#88927] Re: [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical
— Eric Wong <normalperson@...>
2018/09/09
[email protected] wrote:
[#88926] [Ruby trunk Feature#15095] [PATCH] share VM stack between threads and fibers if identical — ko1@...
Issue #15095 has been updated by ko1 (Koichi Sasada).
3 messages
2018/09/09
[#89218] [Ruby trunk Bug#15130] open-uri hangs on cygwin — duerst@...
SXNzdWUgIzE1MTMwIGhhcyBiZWVuIHVwZGF0ZWQgYnkgZHVlcnN0IChNYXJ0aW4gRMO8cnN0KS4K
5 messages
2018/09/30
[ruby-core:88892] [Ruby trunk Bug#15088] Leaky behaviour when GC disabled
From:
liamtabi@...
Date:
2018-09-07 15:59:57 UTC
List:
ruby-core #88892
Issue #15088 has been reported by william101 (William Tabi).
----------------------------------------
Bug #15088: Leaky behaviour when GC disabled
https://bugs.ruby-lang.org/issues/15088
* Author: william101 (William Tabi)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-darwin17]
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Hello
I've observed some leaky behaviour when creating dynamic Symbols ("string".to_sym) when GC is disabled. Creating a dynamic symbol after running `GC.disable` creates an extra string allocation that isn't garbage collected when GC is enabled later on in the code.
Based on https://bugs.ruby-lang.org/issues/9634 and https://bugs.ruby-lang.org/issues/7791, I would have expected all the memory allocated by #to_sym to be GC'ed
I can reproduce this using
~~~ ruby
# frozen_string_literal: true
require 'objspace'
GC.start
puts"Before - All: #{ObjectSpace.each_object.count}"
puts"Before - Symbols: #{Symbol.all_symbols.size}"
GC.start
GC.disable
100_000.times do |i|
"to_sym_#{i}".to_sym
end
GC.enable
GC.start
puts"After - All: #{ObjectSpace.each_object.count}"
puts"After - Symbols: #{Symbol.all_symbols.size}"
~~~
This is the output:
with latest master v2.6.0-dev
~~~
$ RBENV_VERSION=2.6.0-dev ruby -v /tmp/test.rb
ruby 2.6.0dev (2018-09-07 trunk 64657) [x86_64-darwin17]
Before - All: 10740
Before - Symbols: 3206
After - All: 110739
After - Symbols: 3206
~~~
with ruby v2.2.2
~~~
$ RBENV_VERSION=2.2.2 ruby -v /tmp/test.rb
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin17]
Before - All: 6342
Before - Symbols: 2536
After - All: 106344
After - Symbols: 2536
~~~
Would anyone know if this is expected behaviour or a bug?
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>