Skip to content

Instantly share code, notes, and snippets.

diff --git a/gc.c b/gc.c
index 0f84e22..8efd053 100644
--- a/gc.c
+++ b/gc.c
@@ -393,6 +393,7 @@ typedef struct rb_objspace {
struct gc_list *global_list;
size_t count;
int gc_stress;
+ int gc_disable_lazy_sweep;
} rb_objspace_t;
@authorNari
authorNari / gc-cow.rb
Created March 24, 2012 00:38 — forked from wr0ngway/gc-cow.rb
test to see if GC in ruby 2 is truly copy on write friendly
#!/usr/bin/env ruby
rss = '.+?Rss:\s+(\d+)'
share = '.+?Shared_Clean:\s+(\d+)'
share << '.+?Shared_Dirty:\s+(\d+)'
priv = '.+?Private_Clean:\s+(\d+)'
priv << '.+?Private_Dirty:\s+(\d+)'
MEM_REGEXP = /\[heap\]#{rss}#{share}#{priv}/m
def mem_usage()