Variable: gc-cons-percentage

gc-cons-percentage is a customizable variable defined in alloc.c.

Value

1.0

Documentation

Portion of the heap used for allocation.

Garbage collection can happen automatically once this portion of the heap has been allocated since the last garbage collection.

By binding this temporarily to a large number, you can effectively prevent garbage collection during a part of the program. But be sure to get back to the normal value soon enough, to avoid system-wide memory pressure, and never use a too-high value for prolonged periods of time.

If this portion is smaller than gc-cons-threshold, this is ignored.

View in manual

Probably introduced at or before Emacs version 22.1.

Source Code

// Defined in /usr/src/emacs/src/alloc.c
  DEFVAR_LISP ("gc-cons-percentage", Vgc_cons_percentage,
	       doc: /* Portion of the heap used for allocation.
Garbage collection can happen automatically once this portion of the heap
has been allocated since the last garbage collection.

By binding this temporarily to a large number, you can effectively
prevent garbage collection during a part of the program.  But be
sure to get back to the normal value soon enough, to avoid system-wide
memory pressure, and never use a too-high value for prolonged periods
of time.

If this portion is smaller than `gc-cons-threshold', this is ignored.  */);