[#50466] [ruby-trunk - Bug #7492][Open] Segmentation fault at DL::TestDL#test_call_double on x64 Windows 8 — "phasis68 (Heesob Park)" <phasis@...>

23 messages 2012/12/02

[#50558] [ruby-trunk - Feature #7511][Open] short-circuiting logical implication operator — "rits (First Last)" <redmine@...>

12 messages 2012/12/04

[#50575] [ruby-trunk - Feature #7517][Open] Fixnum::MIN,MAX — "matz (Yukihiro Matsumoto)" <matz@...>

20 messages 2012/12/05

[#50755] Becoming a committer — Charlie Somerville <charlie@...>

Hi ruby-core,

21 messages 2012/12/11
[#50759] Re: Becoming a committer — Yukihiro Matsumoto <matz@...> 2012/12/11

Hi,

[#50784] Re: Becoming a committer — Charles Oliver Nutter <headius@...> 2012/12/11

It's really this easy? If so, I'll send over my public key today :)

[#50795] Re: Becoming a committer — Yukihiro Matsumoto <matz@...> 2012/12/11

Hi,

[#50806] [ruby-trunk - Feature #7548][Open] Load and Require Callbacks — "trans (Thomas Sawyer)" <transfire@...>

12 messages 2012/12/12

[#50810] [ruby-trunk - Feature #7549][Open] A Ruby Design Process — "brixen (Brian Ford)" <brixen@...>

34 messages 2012/12/12

[#50867] [ruby-trunk - Bug #7556][Assigned] test error on refinement — "usa (Usaku NAKAMURA)" <usa@...>

14 messages 2012/12/13

[#50900] [ruby-trunk - Bug #7564][Open] r38175 introduces incompatibility — "tenderlovemaking (Aaron Patterson)" <aaron@...>

14 messages 2012/12/14

[#50951] [ruby-trunk - Bug #7584][Open] Ruby hangs when shutting down an ssl connection in gc finalization — "bpot (Bob Potter)" <bobby.potter@...>

12 messages 2012/12/17

[#51076] [ruby-trunk - Feature #7604][Open] Make === comparison operator ability to delegate comparison to an argument — "prijutme4ty (Ilya Vorontsov)" <prijutme4ty@...>

12 messages 2012/12/22

[#51170] [ruby-trunk - Bug #7629][Open] Segmentation fault — "atd (Antonio Tapiador)" <atapiador@...>

13 messages 2012/12/28

[ruby-core:50584] [ruby-trunk - Feature #7472][Rejected] Add a mechanism to remove objects from the GC cycle

From: "mame (Yusuke Endoh)" <mame@...>
Date: 2012-12-05 16:03:54 UTC
List: ruby-core #50584
Issue #7472 has been updated by mame (Yusuke Endoh).

Status changed from Open to Rejected


----------------------------------------
Feature #7472: Add a mechanism to remove objects from the GC cycle
https://bugs.ruby-lang.org/issues/7472#change-34425

Author: sam.saffron (Sam Saffron)
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 2.0.0


For typical rails apps there is a huge largely static object graph in memory. Requests come in, some objects are added, and the GC runs. 

The blocking nature of the GC introduces a jitter that stops all execution. 

In our typicalish Rails application, we see approximately 500k objects in the object space, each request add about 150k objects. On our production machine this means the GC stops execution for 30-40ms on a fairly beefy box: 

GC Profiler ran during this request, if it fired you will see the cost below:

GC 457 invokes.
Index    Invoke Time(sec)       Use Size(byte)     Total Size(byte)         Total Object                    GC Time(ms)
    1              11.169             13134480             17014400               425360        40.00200000000120326149
    2              11.249             13350000             17014400               425360        32.00199999999853162080


It is clear that introducing a full scoped generational GC is a massive undertaking, but I was thinking that certain GC apis can make application servers like thin,unicorn or puma operate way more efficiently. 

How about we add.

GC.skip(object) # remove object from GC cycle, essentially copy the ref to a place that is not scanned 
GC.queue(object) # add an object back to the GC cycle 
GC.skipped # list all the objects that are skipped


Careful use of these methods can reduce GC code by a very large amount as it would reduce fragmentation and logic required to determine if an object is alive or not. 

Application servers could keep snapshots of object ids on regular intervals and decide which ones to skip. Sure memory usage would rise, but GC blocking would decrease. 

Thoughts? 


-- 
http://bugs.ruby-lang.org/

In This Thread

Prev Next