undo-strong-limit

undo-strong-limit is a variable defined in `C source code'.
Its value is
120000


Documentation:
Don't keep more than this much size of undo information.
This limit is applied when garbage collection happens.
When a previous command increases the total undo list size past this
value, that command and the earlier commands that came before it are forgotten.
However, the most recent buffer-modifying command's undo info
is never discarded for this reason.

The size is counted as the number of bytes occupied,
which includes both saved text and other data.

You can customize this variable.