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