aboutsummaryrefslogtreecommitdiff
path: root/manual
diff options
context:
space:
mode:
Diffstat (limited to 'manual')
-rw-r--r--manual/manual.of43
1 files changed, 22 insertions, 21 deletions
diff --git a/manual/manual.of b/manual/manual.of
index 1ac537f7..c93fbfcb 100644
--- a/manual/manual.of
+++ b/manual/manual.of
@@ -608,8 +608,8 @@ An object is considered @def{dead}
608as soon as the collector can be sure the object 608as soon as the collector can be sure the object
609will not be accessed again in the normal execution of the program. 609will not be accessed again in the normal execution of the program.
610(@Q{Normal execution} here excludes finalizers, 610(@Q{Normal execution} here excludes finalizers,
611which can resurrect dead objects @see{finalizers}, 611which resurrect dead objects @see{finalizers},
612and excludes also operations using the debug library.) 612and it excludes also some operations using the debug library.)
613Note that the time when the collector can be sure that an object 613Note that the time when the collector can be sure that an object
614is dead may not coincide with the programmer's expectations. 614is dead may not coincide with the programmer's expectations.
615The only guarantees are that Lua will not collect an object 615The only guarantees are that Lua will not collect an object
@@ -657,25 +657,27 @@ and the @def{garbage-collector step size}.
657 657
658The garbage-collector pause 658The garbage-collector pause
659controls how long the collector waits before starting a new cycle. 659controls how long the collector waits before starting a new cycle.
660The collector starts a new cycle when the number of objects 660The collector starts a new cycle when the number of bytes
661hits @M{n%} of the total after the previous collection. 661hits @M{n%} of the total after the previous collection.
662Larger values make the collector less aggressive. 662Larger values make the collector less aggressive.
663Values equal to or less than 100 mean the collector will not wait to 663Values equal to or less than 100 mean the collector will not wait to
664start a new cycle. 664start a new cycle.
665A value of 200 means that the collector waits for 665A value of 200 means that the collector waits for
666the total number of objects to double before starting a new cycle. 666the total number of bytes to double before starting a new cycle.
667 667
668The garbage-collector step size controls the 668The garbage-collector step size controls the
669size of each incremental step, 669size of each incremental step,
670specifically how many objects the interpreter creates 670specifically how many bytes the interpreter allocates
671before performing a step: 671before performing a step:
672A value of @M{n} means the interpreter will create 672A value of @M{n} means the interpreter will allocate
673approximately @M{n} objects between steps. 673approximately @M{n} bytes between steps.
674 674
675The garbage-collector step multiplier 675The garbage-collector step multiplier
676controls the size of each GC step. 676controls how much work each incremental step does.
677A value of @M{n} means the interpreter will mark or sweep, 677A value of @M{n} means the interpreter will execute
678in each step, @M{n%} objects for each created object. 678@M{n%} @emphx{units of work} for each byte allocated.
679A unit of work corresponds roughly to traversing one slot
680or sweeping one object.
679Larger values make the collector more aggressive. 681Larger values make the collector more aggressive.
680Beware that values too small can 682Beware that values too small can
681make the collector too slow to ever finish a cycle. 683make the collector too slow to ever finish a cycle.
@@ -689,7 +691,7 @@ effectively producing a non-incremental, stop-the-world collector.
689In generational mode, 691In generational mode,
690the collector does frequent @emph{minor} collections, 692the collector does frequent @emph{minor} collections,
691which traverses only objects recently created. 693which traverses only objects recently created.
692If after a minor collection the number of objects is above a limit, 694If after a minor collection the number of bytes is above a limit,
693the collector shifts to a @emph{major} collection, 695the collector shifts to a @emph{major} collection,
694which traverses all objects. 696which traverses all objects.
695The collector will then stay doing major collections until 697The collector will then stay doing major collections until
@@ -702,30 +704,30 @@ and the @def{major-minor multiplier}.
702 704
703The minor multiplier controls the frequency of minor collections. 705The minor multiplier controls the frequency of minor collections.
704For a minor multiplier @M{x}, 706For a minor multiplier @M{x},
705a new minor collection will be done when the number of objects 707a new minor collection will be done when the number of bytes
706grows @M{x%} larger than the number in use just 708grows @M{x%} larger than the number in use just
707after the last major collection. 709after the last major collection.
708For instance, for a multiplier of 20, 710For instance, for a multiplier of 20,
709the collector will do a minor collection when the number of objects 711the collector will do a minor collection when the number of bytes
710gets 20% larger than the total after the last major collection. 712gets 20% larger than the total after the last major collection.
711 713
712The minor-major multiplier controls the shift to major collections. 714The minor-major multiplier controls the shift to major collections.
713For a multiplier @M{x}, 715For a multiplier @M{x},
714the collector will shift to a major collection 716the collector will shift to a major collection
715when the number of old objects grows @M{x%} larger 717when the number of bytes from old objects grows @M{x%} larger
716than the total after the previous major collection. 718than the total after the previous major collection.
717For instance, for a multiplier of 100, 719For instance, for a multiplier of 100,
718the collector will do a major collection when the number of old objects 720the collector will do a major collection when the number of old bytes
719gets larger than twice the total after the previous major collection. 721gets larger than twice the total after the previous major collection.
720 722
721The major-minor multiplier controls the shift back to minor collections. 723The major-minor multiplier controls the shift back to minor collections.
722For a multiplier @M{x}, 724For a multiplier @M{x},
723the collector will shift back to minor collections 725the collector will shift back to minor collections
724after a major collection collects at least @M{x%} 726after a major collection collects at least @M{x%}
725of the objects allocated during the last cycle. 727of the bytes allocated during the last cycle.
726In particular, for a multiplier of 0, 728In particular, for a multiplier of 0,
727the collector will immediately shift back to minor collections 729the collector will immediately shift back to minor collections
728after doing one cycle of major collections. 730after doing one major collection.
729 731
730} 732}
731 733
@@ -6404,23 +6406,22 @@ gives the exact number of bytes in use by Lua.
6404Performs a garbage-collection step. 6406Performs a garbage-collection step.
6405This option may be followed by an extra argument, 6407This option may be followed by an extra argument,
6406an integer with the step size. 6408an integer with the step size.
6407The default for this argument is zero.
6408 6409
6409If the size is a positive @id{n}, 6410If the size is a positive @id{n},
6410the collector acts as if @id{n} new objects have been created. 6411the collector acts as if @id{n} new bytes have been allocated.
6411If the size is zero, 6412If the size is zero,
6412the collector performs a basic step. 6413the collector performs a basic step.
6413In incremental mode, 6414In incremental mode,
6414a basic step corresponds to the current step size. 6415a basic step corresponds to the current step size.
6415In generational mode, 6416In generational mode,
6416a basic step performs a full minor collection or 6417a basic step performs a full minor collection or
6417a major collection, 6418an incremental step,
6418if the collector has scheduled one. 6419if the collector has scheduled one.
6419 6420
6420In incremental mode, 6421In incremental mode,
6421the function returns @true if the step finished a collection cycle. 6422the function returns @true if the step finished a collection cycle.
6422In generational mode, 6423In generational mode,
6423the function returns @true if the step performed a major collection. 6424the function returns @true if the step finished a major collection.
6424} 6425}
6425 6426
6426@item{@St{isrunning}| 6427@item{@St{isrunning}|