Document GC.config
This commit is contained in:
parent
4d77803a66
commit
3ccc6e0b6a
46
gc.rb
46
gc.rb
@ -259,18 +259,50 @@ module GC
|
|||||||
#
|
#
|
||||||
# Sets or gets information about the current GC config.
|
# Sets or gets information about the current GC config.
|
||||||
#
|
#
|
||||||
# The contents of the hash are implementation specific and may change in
|
# Configuration parameters are GC implementation specific and may change
|
||||||
# the future without notice.
|
# without notice.
|
||||||
#
|
#
|
||||||
# If the optional argument, hash, is given, it is overwritten and returned.
|
# This method can be called without parameters to retrieve the current config.
|
||||||
|
#
|
||||||
|
# This method can also be called with a +Hash+ argument to assign values to
|
||||||
|
# valid config keys. Config keys missing from the passed +Hash+ will be left
|
||||||
|
# unmodified.
|
||||||
|
#
|
||||||
|
# If a key/value pair is passed to this function that does not correspond to
|
||||||
|
# a valid config key for the GC implementation being used, no config will be
|
||||||
|
# updated, the key will be present in the returned Hash, and it's value will
|
||||||
|
# be +nil+. This is to facilitate easy migration between GC implementations.
|
||||||
|
#
|
||||||
|
# In both call-seqs the return value of <code>GC.config</code> will be a +Hash+
|
||||||
|
# containing the most recent full configuration. ie. All keys and values
|
||||||
|
# defined by the specific GC implementation being used. In the case of a
|
||||||
|
# config update, the return value will include the new values being updated.
|
||||||
#
|
#
|
||||||
# This method is only expected to work on CRuby.
|
# This method is only expected to work on CRuby.
|
||||||
#
|
#
|
||||||
# The hash includes the following keys about the internal information in
|
# Valid config keys for Ruby's default GC implementation are:
|
||||||
# the \GC:
|
|
||||||
#
|
#
|
||||||
# [slot_size]
|
# [rgengc_allow_full_mark]
|
||||||
# The slot size of the heap in bytes.
|
# Control whether the GC is allowed to run a full mark (young & old objects).
|
||||||
|
#
|
||||||
|
# When +true+ GC interleaves major and minor collections. This is default. GC
|
||||||
|
# will function as intended.
|
||||||
|
#
|
||||||
|
# When +false+, the GC will never trigger a full marking cycle unless
|
||||||
|
# explicitly requested by user code. Instead only a minor mark will run -
|
||||||
|
# only young objects will be marked. When the heap space is exhausted, new
|
||||||
|
# pages will be allocated immediately instead of running a full mark.
|
||||||
|
#
|
||||||
|
# A flag will be set to notify that a full mark has been
|
||||||
|
# requested. This flag is accessible using
|
||||||
|
# <code>GC.latest_gc_info(:needs_major_by)</code>
|
||||||
|
#
|
||||||
|
# The user can trigger a major collection at any time using
|
||||||
|
# <code>GC.start(full_mark: true)</code>
|
||||||
|
#
|
||||||
|
# When +false+. Young to Old object promotion is disabled. For performance
|
||||||
|
# reasons it is recommended to warmup an application using +Process.warmup+
|
||||||
|
# before setting this parameter to +false+.
|
||||||
def self.config hash = nil
|
def self.config hash = nil
|
||||||
return Primitive.gc_config_get unless hash
|
return Primitive.gc_config_get unless hash
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user