zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <psprint@zdharma.org>
To: zsh-workers@zsh.org
Subject: Re: Optimizations, extra memory of (r) flag (the padding)
Date: Mon, 10 Apr 2017 06:31:05 +0200	[thread overview]
Message-ID: <etPan.58eb0a89.238e1f29.15fbc@MacMini.local> (raw)
In-Reply-To: <etPan.58e9d581.643c9869.15fbc@MacMini.local>

On 9 April 2017 at 09:00:00, Sebastian Gniazdowski (psprint@zdharma.org) wrote:
> without test-zsh running). So I dropped the test, because saturating 270 MB with array  
> append without optimizations could take more than a day. That said, why the extra memory  
> on current HEAD?

I bisected this to:

9f8e3e8    36834: freeheap preserves last allocated heap

It was an important optimization that made Zsh fast under heavy memory loads. To see the double-memory usage:

% a=${(r:1024*1024*100::_:)x}
% mem() { ps -axv | grep $$ }
% mem
21525 S      0:06.20   0   0      0  2681728 222308     -        0   1,3  2,7 /usr/local/bin/zsh-5.3.1-dev-0 -i

RSS is 8th column. So, instead of 100 MB, there's 200 MB. However, to show that this is heap memory hanging around:

% repeat 1; do a=${(r:1024*1024*100::_:)x}; done
% mem
21772 S      0:05.84   0   0      0  2579324 119932     -        0   2,7  1,4 /usr/local/bin/zsh-5.3.1-dev-0 -i

Now things are in check – 100 MB (119932) in `ps`. I think this isn't a big problem, that heap memory can hang around longer, if it boosts Zsh speed under high memory loads.

--
Sebastian Gniazdowski
psprint /at/ zdharma.org


  parent reply	other threads:[~2017-04-10  4:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-09  6:32 Sebastian Gniazdowski
2017-04-09  7:16 ` Sebastian Gniazdowski
2017-04-09 18:33 ` Daniel Shahaf
2017-04-10  4:31 ` Sebastian Gniazdowski [this message]
2017-04-10 21:33   ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=etPan.58eb0a89.238e1f29.15fbc@MacMini.local \
    --to=psprint@zdharma.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).