From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chris Findeisen Newsgroups: gmane.emacs.bugs Subject: bug#30943: save-hist creates massive cache file Date: Sun, 25 Mar 2018 19:11:21 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005aedda0568416e4a" X-Trace: blaine.gmane.org 1522018632 471 195.159.176.226 (25 Mar 2018 22:57:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 25 Mar 2018 22:57:12 +0000 (UTC) To: 30943@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Mar 26 00:57:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0EZY-0008S9-2Z for geb-bug-gnu-emacs@m.gmane.org; Mon, 26 Mar 2018 00:57:08 +0200 Original-Received: from localhost ([::1]:52789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0Ebb-0002aX-DO for geb-bug-gnu-emacs@m.gmane.org; Sun, 25 Mar 2018 18:59:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0EbP-0002Yg-Vh for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2018 18:59:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0EbP-00088L-2n for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2018 18:59:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45375) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0EbO-00088E-UF for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2018 18:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f0EbO-0004Ui-KR for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2018 18:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chris Findeisen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Mar 2018 22:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30943 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.152201869717193 (code B ref -1); Sun, 25 Mar 2018 22:59:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 25 Mar 2018 22:58:17 +0000 Original-Received: from localhost ([127.0.0.1]:53268 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0Eae-0004TF-Qy for submit@debbugs.gnu.org; Sun, 25 Mar 2018 18:58:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f0B3n-0007eb-8y for submit@debbugs.gnu.org; Sun, 25 Mar 2018 15:12:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0B3h-0007LY-4J for submit@debbugs.gnu.org; Sun, 25 Mar 2018 15:12:01 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:32864) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f0B3h-0007LS-0S for submit@debbugs.gnu.org; Sun, 25 Mar 2018 15:12:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0B3f-0004QC-VD for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2018 15:12:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0B3f-0007JE-3o for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2018 15:11:59 -0400 Original-Received: from mail-it0-x229.google.com ([2607:f8b0:4001:c0b::229]:50413) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0B3e-0007II-Sk for bug-gnu-emacs@gnu.org; Sun, 25 Mar 2018 15:11:59 -0400 Original-Received: by mail-it0-x229.google.com with SMTP id d13-v6so8119145itf.0 for ; Sun, 25 Mar 2018 12:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xTp3xEK4yH6K/xnV2ZSh2VHm1TICfQ+SbAHkM17SjW4=; b=DvlCmZ5I4J7fF3VLoU1ZFTV1CNJeDiUiwdAJ978d0w+JSR51jObVkXXG0tQiFgbI9a hCoQyY3WWfaftF+wyUBEcj/cYJ8fprWM1tJCFvOgIm2LVEbvcrGq+7Qby+XzYhTeIPGC SCm15ZktSna1YgnZNQEKPZ+Watj+4RnN2/uzdHakRHWTLoZBvle0wtPFoUh9zq+ZITV+ CRscdksdZgJF5okouToIdhXt6Msh84rmLQk3E11rNrSDYtCwcKgNyoZEAogH2yJHKHdU 9Yg//FNvPE8KZDLWmGo2f0LkEZcenK8GPu8WprfAyBDNzKFWPRRYArGngcylp1uw0Zd6 CPEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xTp3xEK4yH6K/xnV2ZSh2VHm1TICfQ+SbAHkM17SjW4=; b=Uu/T7jRFUPNQRNyMHbR7A+tWKpVHalNjm/zfuBc0Ka8dMyo/a5Pd3NEjh0uG4hDBfX eHtT0Y7+2TiE42Yp828pGMfuq++3NRPpj++chXCY4B5VdkfT/LZxsVZbLgBkn5xZkA0C xKp29CCtcJyltCClMfTlbmasriEYJH3GngTqXdfZ+iaefZ370diqjDSSwGInfYsQsprl KVzgl1hg+ZJFwN9a3/FN6G4TznqaAndGq3OXLdVUJ7SK7yfll7YRx+39uWMlp+FqVphl a7YjjuXJA9qDnDwEyHZzpO4VOYBEPsP0qpNYcZ006oegIG4q2pjtzB0lrE+j9Y74l0DN U3Yg== X-Gm-Message-State: AElRT7EByd86U95nk6IxPIW3Umn72uucrRnNj0q1PEVgKUMlEhci4nnb 4HV1WGTQ6LcKVeCbKkjTKmXqIHb0WiPW+fSx8ftYAh7Szls= X-Google-Smtp-Source: AG47ELttapGmwoTb4kkrlZeqazOjNqw1n5wHzaX60GxjSaHm1DsCBIpP1EFd0J7MsL6gbZ/ZYwCEK35fUASRL7no5t0= X-Received: by 2002:a24:7813:: with SMTP id p19-v6mr19540499itc.93.1522005117127; Sun, 25 Mar 2018 12:11:57 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Sun, 25 Mar 2018 18:58:15 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:144616 Archived-At: --0000000000005aedda0568416e4a Content-Type: text/plain; charset="UTF-8" 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. --0000000000005aedda0568416e4a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
save-hist-additional-variables never ge= t truncated by save-hist, leading
to a massive cache file a= nd slowdown. Practically, this matters when the cache file silently grows t= o 1/2 a GB, and emacs begins randomly freezing.

history-length is su= pposed to keep a limit on the max history for save-hist-additional-variable= s, but it doesn't.

In the savehist-sav= e function:

= (dolist (symbol savehist-minibuffer-history-variables)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (when (and (boundp symbol)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(not (memq symbol savehist-ign= ored-variables)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= (let ((value (savehist-trim-history (symbol-value symbol)))
=C2=A0 ))))

(dolist = (symbol savehist-additional-variables)
=C2=A0 (when (boundp= symbol)
=C2=A0 =C2=A0 (let ((value (symbol-value symbol)))=
=C2=A0 =C2=A0 (when (savehist-printable value)

=C2=A0 =C2=A0 ;; ...
=C2=A0 =C2=A0 ))))

As you = can see, the save-hist-trim-history fn is not called in the
second code block.
--0000000000005aedda0568416e4a--