1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/include/ruby
ko1 325d2cfcdf * gc.c: add 3gen GC patch, but disabled as default.
RGenGC is designed as 2 generational GC, young and old generation.
  Young objects will be promoted to old objects after one GC.
  Old objects are not collect until major (full) GC.
  The issue of this approach is some objects can promoted as old
  objects accidentally and not freed until major GC.
  Major GC is not frequently so short-lived but accidentally becoming
  old objects are not freed.
  For example, the program "loop{Array.new(1_000_000)}" consumes huge
  memories because short lived objects (an array which has 1M
  elements) are promoted while GC and they are not freed before major
  GC.
  To solve this problem, generational GC with more generations
  technique is known. This patch implements three generations gen GC.
  At first, newly created objects are "Infant" objects.
  After surviving one GC, "Infant" objects are promoted to "Young"
  objects.
  "Young" objects are promoted to "Old" objects after surviving
  next GC.
  "Infant" and "Young" objects are collected if it is not marked
  while minor GC. So that this technique solves this problem.
  Representation of generations:
  * Infant: !FL_PROMOTED and !oldgen_bitmap [00]
  * Young :  FL_PROMOTED and !oldgen_bitmap [10]
  * Old   :  FL_PROMOTED and  oldgen_bitmap [11]
  The macro "RGENGC_THREEGEN" enables/disables this feature, and
  turned off as default because there are several problems.
  (1) Failed sometimes (Heisenbugs).
  (2) Performance down.
      Especially on write barriers. We need to detect Young or Old
      object by oldgen_bitmap. It is slower than checking flags.
  To evaluate this feature on more applications, I commit this patch.
  Reports are very welcome.
  This patch includes some refactoring (renaming names, etc).
* include/ruby/ruby.h: catch up 3gen GC.
* .gdbinit: fix to show a prompt "[PROMOTED]" for promoted objects.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-04 18:59:33 +00:00
..
backward defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} 2013-04-05 10:29:38 +00:00
debug.h * include/ruby/debug.h, 2013-10-09 00:21:51 +00:00
defines.h * include/ruby/defines.h: Fix a compilation error with 2013-08-19 12:39:09 +00:00
encoding.h transcode.c: add rb_econv_append 2013-09-06 02:45:50 +00:00
intern.h string.c: export rb_str_scrub 2013-11-01 07:55:56 +00:00
io.h file.c: export rb_stat_new 2013-10-01 11:54:53 +00:00
missing.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} 2013-04-05 10:29:38 +00:00
oniguruma.h Revert r41786 "broken utf-8" 2013-07-09 07:38:15 +00:00
re.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} 2013-04-05 10:29:38 +00:00
regex.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} 2013-04-05 10:29:38 +00:00
ruby.h * gc.c: add 3gen GC patch, but disabled as default. 2013-11-04 18:59:33 +00:00
st.h st.c: revert st_keys 2013-10-10 16:28:56 +00:00
subst.h
thread.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} 2013-04-05 10:29:38 +00:00
util.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} 2013-04-05 10:29:38 +00:00
version.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} 2013-04-05 10:29:38 +00:00
vm.h defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END} 2013-04-05 10:29:38 +00:00
win32.h win32.h: suppress INFINITY warnings 2013-10-23 16:34:22 +00:00