From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24461 invoked by alias); 25 Jun 2016 01:47:55 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21705 Received: (qmail 23160 invoked from network); 25 Jun 2016 01:47:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=JiXRlB+T+LVUxbCP3zE5c7zPIcFZMg3bTrFhrTPIeII=; b=JLsIkRKuQUIPDgQmVpmUkXRI99WOeZjHzPCWnxIyVatXbAQJppEcJsmvzOxJKPRikF Lj+kWYmaISeaR1onYk1+/0nCovkflmpQcNSnwOaoS7762MiRH72O+5+NmGwcexjof1na B9ta3QBGWqSg8Xyjd8NsNu/9YtRoOdv/0EJcZlA0NjiLAqkdipwvW3veIyfzmeWmUMd+ u419Geuerp5oEv3Z69nJjcNEIZEkkZgHp/2mOvqMN/SharumKouj201wjCVjEJMz2YG4 M7Fpr10uIa8sOzR3/F4M/BvPZ7/p/Qb3+9E5mLTWnrGw5dD3F6KuTqr/rk0KgOjs2NJH 6CIw== X-Gm-Message-State: ALyK8tKchB8MoLKzdesOElWeYwgxC4g8L+vgoAGUnlklxKhKSUDIXLBUsncuQF4cS5nEjdahC37C7DWN6dw+6Q== X-Received: by 10.46.5.138 with SMTP id 132mr2182476ljf.9.1466819267818; Fri, 24 Jun 2016 18:47:47 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160624134706.GA22704@linux.vnet.ibm.com> References: <20160624134706.GA22704@linux.vnet.ibm.com> From: Bart Schaefer Date: Fri, 24 Jun 2016 18:47:47 -0700 Message-ID: Subject: Re: Memory usage of history? To: Zsh Users , Robin Dapp Content-Type: text/plain; charset=UTF-8 On Fri, Jun 24, 2016 at 6:47 AM, Dominik Vogt 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 information: * 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.