Zsh Mailing List Archive
Messages sorted by:
Re: Memory usage of history?
- X-seq: zsh-users 21705
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>, Robin Dapp <rdapp@xxxxxxxxxxxxxxxxxx>
- Subject: Re: Memory usage of history?
- Date: Fri, 24 Jun 2016 18:47:47 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=JiXRlB+T+LVUxbCP3zE5c7zPIcFZMg3bTrFhrTPIeII=; b=KOUzH+0zeFIKJ8T220GhtJNZqIC7qBCNF7AyXNGHhh+6W/UCsrO4Uup5SC2cogWzZI fmj9gsCZA89Kl88yKBvE1m5rNxcDMwXKmlU8Y8+aSPvszZc9kBpkOcg2cXVKDmibJrhW 8APGsjEm1j5HsErPrDx7CeziVv9qnVb2gge4hiF+DDdKCY7R7ChAIKX51vDC7o5dwrGB WCDWvgRpBSM+UObl0bP5H/LnFdMdQ5fCnn6qLbLG/jdYbztCc/dMETIkY91KIaOOOLV3 g9xfSGy7n2nV7CExRviasrphaBkFFBU9hlD5tj/vOlBzrOhxX//er9GFRwpLpdHj2U6f Jf1Q==
- In-reply-to: <20160624134706.GA22704@linux.vnet.ibm.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20160624134706.GA22704@linux.vnet.ibm.com>
On Fri, Jun 24, 2016 at 6:47 AM, Dominik Vogt <vogt@xxxxxxxxxxxxxxxxxx> wrote:
> (A colleague
> says his zshs use 200 MB memory each with a history size of a
> million lines).
To expand on Eric's answer, zsh reads the entire $HISTFILE and retains
the last $HISTSIZE entries. So a large $HISTFILE also slows down
startup, even if it doesn't consume lots of memory.
I can't imagine anyone having a million useful lines of history. A
few tens of thousands at most. Things he might consider that would
allow him to reduce SAVEHIST and/or HISTSIZE without losing too much
* Set the hist_ignore_all_dups option, if he doesn't already.
* Set the hist_save_no_dups option, similarly.
* Define a zshaddhistory function to filter out commands that are
unlikely to be used again.
If he isn't already ignoring / not saving duplicates, an interesting
experiment might be to add hist_ignore_all_dups without changing
HISTSIZE, then run zsh and see how many lines of history actually end
up being retained.
Messages sorted by: