save-hist-additional-variables never get truncated by save-hist, leading
to a massive cache file and slowdown. Practically, this matters when the cache file silently grows to 1/2 a GB, and emacs begins randomly freezing.
history-length is supposed to keep a limit on the max history for save-hist-additional-variables, but it doesn't.
In the savehist-save function:
(dolist (symbol savehist-minibuffer-history-variables)
(when (and (boundp symbol)
(not (memq symbol savehist-ignored-variables)))
(let ((value (savehist-trim-history (symbol-value symbol)))
;;....
))))
(dolist (symbol savehist-additional-variables)
(when (boundp symbol)
(let ((value (symbol-value symbol)))
(when (savehist-printable value)
;; ...
))))
As you can see, the save-hist-trim-history fn is not called in the
second code block.