summaryrefslogtreecommitdiff
path: root/.gdbinit
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-04 18:59:33 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-04 18:59:33 +0000
commit325d2cfcdfd2beeca4aa45368276d2f2c928ae59 (patch)
tree78bce5d6a1be827c54da23fa9509bcae5988901c /.gdbinit
parent30456e9607308d79cb3e5a40bdb73023780d243a (diff)
* 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
Diffstat (limited to '.gdbinit')
-rw-r--r--.gdbinit3
1 files changed, 3 insertions, 0 deletions
diff --git a/.gdbinit b/.gdbinit
index 327a043963..f71b585b57 100644
--- a/.gdbinit
+++ b/.gdbinit
@@ -50,6 +50,9 @@ define rp
end
else
set $flags = ((struct RBasic*)($arg0))->flags
+ if ($flags & RUBY_FL_ELDERGEN)
+ printf "[PROMOTED] "
+ end
if ($flags & RUBY_T_MASK) == RUBY_T_NONE
printf "%sT_NONE%s: ", $color_type, $color_end
print (struct RBasic *)($arg0)