diff options
| author | Eli Zaretskii | 2022-11-20 13:10:08 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2022-11-20 13:10:08 +0200 |
| commit | 7b09ed28ba395030e5117344bb5b97b8ee4a8b40 (patch) | |
| tree | 4c985a26cd19ec4acece5acc8033b26f5e544865 /src/alloc.c | |
| parent | fbad9c05ea1066c0ae48d40eca782bd406e4c42d (diff) | |
| download | emacs-7b09ed28ba395030e5117344bb5b97b8ee4a8b40.tar.gz emacs-7b09ed28ba395030e5117344bb5b97b8ee4a8b40.zip | |
Advise against using too-high GC thresholds
* doc/lispref/internals.texi (Garbage Collection):
* src/alloc.c (syms_of_alloc) <gc-cons-threshold>
<gc-cons-percentage>: Advise against enlarging the GC thresholds
more than needed and for prolonged periods of time.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c index b9d12dff7e0..d3f696d5ade 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -7775,13 +7775,23 @@ allocated since the last garbage collection. All data types count. | |||
| 7775 | Garbage collection happens automatically only when `eval' is called. | 7775 | Garbage collection happens automatically only when `eval' is called. |
| 7776 | 7776 | ||
| 7777 | By binding this temporarily to a large number, you can effectively | 7777 | By binding this temporarily to a large number, you can effectively |
| 7778 | prevent garbage collection during a part of the program. | 7778 | prevent garbage collection during a part of the program. But be |
| 7779 | sure to get back to the normal value soon enough, to avoid system-wide | ||
| 7780 | memory pressure, and never use a too-high value for prolonged periods | ||
| 7781 | of time. | ||
| 7779 | See also `gc-cons-percentage'. */); | 7782 | See also `gc-cons-percentage'. */); |
| 7780 | 7783 | ||
| 7781 | DEFVAR_LISP ("gc-cons-percentage", Vgc_cons_percentage, | 7784 | DEFVAR_LISP ("gc-cons-percentage", Vgc_cons_percentage, |
| 7782 | doc: /* Portion of the heap used for allocation. | 7785 | doc: /* Portion of the heap used for allocation. |
| 7783 | Garbage collection can happen automatically once this portion of the heap | 7786 | Garbage collection can happen automatically once this portion of the heap |
| 7784 | has been allocated since the last garbage collection. | 7787 | has been allocated since the last garbage collection. |
| 7788 | |||
| 7789 | By binding this temporarily to a large number, you can effectively | ||
| 7790 | prevent garbage collection during a part of the program. But be | ||
| 7791 | sure to get back to the normal value soon enough, to avoid system-wide | ||
| 7792 | memory pressure, and never use a too-high value for prolonged periods | ||
| 7793 | of time. | ||
| 7794 | |||
| 7785 | If this portion is smaller than `gc-cons-threshold', this is ignored. */); | 7795 | If this portion is smaller than `gc-cons-threshold', this is ignored. */); |
| 7786 | Vgc_cons_percentage = make_float (0.1); | 7796 | Vgc_cons_percentage = make_float (0.1); |
| 7787 | 7797 | ||