# translation.gc

- name: gc
- description: Garbage Collection Strategy
- command-line: --gc
- option type: choice option
- possible values:
  - boehm
  - ref
  - semispace
  - statistics
  - generation
  - hybrid
  - minimark
  - incminimark
  - none
- default: ref
- requirements:
  - value 'boehm' requires:
    - translation.continuation to be set to 'False'
    - translation.gctransformer to be set to 'boehm'
  - value 'ref' requires:
    - translation.rweakref to be set to 'False'
    - translation.gctransformer to be set to 'ref'
  - value 'semispace' requires:
    - translation.gctransformer to be set to 'framework'
  - value 'statistics' requires:
    - translation.gctransformer to be set to 'framework'
  - value 'generation' requires:
    - translation.gctransformer to be set to 'framework'
  - value 'hybrid' requires:
    - translation.gctransformer to be set to 'framework'
  - value 'minimark' requires:
    - translation.gctransformer to be set to 'framework'
  - value 'incminimark' requires:
    - translation.gctransformer to be set to 'framework'
  - value 'none' requires:
    - translation.rweakref to be set to 'False'
    - translation.gctransformer to be set to 'none'

Choose the Garbage Collector used by the translated program. The recommended default is "incminimark".

> - "ref": reference counting. Takes very long to translate and the result is slow. Used only for tests. Don't use it for real RPython programs.
> - "none": no GC. Leaks everything. Don't use it for real RPython programs: the rate of leaking is immense.
> - "semispace": a copying semi-space GC.
> - "generation": a generational GC using the semi-space GC for the older generation.
> - "hybrid": a hybrid collector of "generation" together with a mark-n-sweep old space
> - "boehm": use the Boehm conservative GC.
> - "minimark": a generational mark-n-sweep collector with good performance. Includes page marking for large arrays.
> - "incminimark": like minimark, but adds incremental major collections. Seems to come with no performance drawback over "minimark", so it is the default. A few recent features of PyPy (like cpyext) are only working with this GC.