Project

General

Profile

Bug #9137

RUBY_FREE_MIN is not enforced correctly

Added by sam.saffron (Sam Saffron) almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
2.1.0
[ruby-core:58474]

Description

At the moment setting RUBY_FREE_MIN does not work as expected:

All it does is cause heap_set_increment to be triggered more aggressively. heap_set_increment totally ignores it. The end result is

sam@ubuntu:~/Source/ruby$ RUBY_FREE_MIN=$(( 408*1000 )) ruby -e "GC.start; p GC.count; (800*408).times{ '' }; p GC.count"
5
12

So the GC ran 7 times even though we should have heap space to fit the free min.

With this patch: https://github.com/SamSaffron/ruby/commit/b84e11c85b9fcde65dfc9347427e720307ef5a62 we can correct the behavior

sam@ubuntu:~/Source/ruby$ RUBY_FREE_MIN=$(( 408*1000 )) ruby -e "GC.start; p GC.count; (800*408).times{ '' }; p GC.count"
5
5

Associated revisions

Revision c91ec25d
Added by ko1 (Koichi Sasada) almost 6 years ago

  • gc.c (heap_set_increment): accept minumum additional page number.
  • gc.c (gc_after_sweep): allocate pages to allocate at least RUBY_HEAP_MIN_SLOTS. [Bug #9137]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 43795
Added by ko1 (Koichi Sasada) almost 6 years ago

  • gc.c (heap_set_increment): accept minumum additional page number.
  • gc.c (gc_after_sweep): allocate pages to allocate at least RUBY_HEAP_MIN_SLOTS. [Bug #9137]

Revision 43795
Added by ko1 (Koichi Sasada) almost 6 years ago

  • gc.c (heap_set_increment): accept minumum additional page number.
  • gc.c (gc_after_sweep): allocate pages to allocate at least RUBY_HEAP_MIN_SLOTS. [Bug #9137]

Revision 43795
Added by ko1 (Koichi Sasada) almost 6 years ago

  • gc.c (heap_set_increment): accept minumum additional page number.
  • gc.c (gc_after_sweep): allocate pages to allocate at least RUBY_HEAP_MIN_SLOTS. [Bug #9137]

Revision 43795
Added by ko1 (Koichi Sasada) almost 6 years ago

  • gc.c (heap_set_increment): accept minumum additional page number.
  • gc.c (gc_after_sweep): allocate pages to allocate at least RUBY_HEAP_MIN_SLOTS. [Bug #9137]

Revision 43795
Added by ko1 (Koichi Sasada) almost 6 years ago

  • gc.c (heap_set_increment): accept minumum additional page number.
  • gc.c (gc_after_sweep): allocate pages to allocate at least RUBY_HEAP_MIN_SLOTS. [Bug #9137]

Revision 43795
Added by ko1 (Koichi Sasada) almost 6 years ago

  • gc.c (heap_set_increment): accept minumum additional page number.
  • gc.c (gc_after_sweep): allocate pages to allocate at least RUBY_HEAP_MIN_SLOTS. [Bug #9137]

History

#2

Updated by ko1 (Koichi Sasada) almost 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r43795.
Sam, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • gc.c (heap_set_increment): accept minumum additional page number.
  • gc.c (gc_after_sweep): allocate pages to allocate at least RUBY_HEAP_MIN_SLOTS. [Bug #9137]

Also available in: Atom PDF