From owner-freebsd-questions Mon Sep 23 06:48:57 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id GAA29749 for questions-outgoing; Mon, 23 Sep 1996 06:48:57 -0700 (PDT) Received: from dyson.iquest.net (dyson.iquest.net [198.70.144.127]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id GAA29724 for ; Mon, 23 Sep 1996 06:48:51 -0700 (PDT) Received: (from root@localhost) by dyson.iquest.net (8.7.5/8.6.9) id IAA10130; Mon, 23 Sep 1996 08:48:37 -0500 (EST) From: "John S. Dyson" Message-Id: <199609231348.IAA10130@dyson.iquest.net> Subject: Re: ksh [was: Re: Shells shells shells?] To: zgabor@CoDe.hu (Gabor Zahemszky) Date: Mon, 23 Sep 1996 08:48:37 -0500 (EST) Cc: freebsd-questions@FreeBSD.ORG, tony@rtd.com In-Reply-To: <199609231018.KAA01709@CoDe.CoDe.hu> from "Gabor Zahemszky" at Sep 23, 96 10:18:41 am Reply-To: dyson@FreeBSD.ORG X-Mailer: ELM [version 2.4 PL24 ME8] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > > Anyway the version I have (downloaded ~ Aug 95) is larger than even bash. > > > > $ size /usr/local/bin/ksh > > text data bss dec hex > > 409600 16384 8724 434708 6a214 > I just measured the memory usage of bash vs. ksh93. It is true that the .text is larger for the new ksh. However, the per-process .data/.bss is much smaller. Specifically, bash is using approx 68pages!!! of .data/.bss per invocation. Ksh uses about 18 pages per invocation. But bash uses 69pages of constant (and shared) .text and ksh uses 97 pages of constant (and shared) .text. If you are going to choose between ksh and bash on a heavily used system, it appears that ksh might use less real memory in the long run. (Note that the /proc/xxx/map file is useful for figuring these things out!!!) It is really amazing that bash uses so much memory. I haven't measured the memory usage when some of the pages have been reclaimed by paging. Bash is probably using less pages than indicated after process startup though. Since shell processes are used so often, it would be interested to benchmark a system (under load) with the various shells to find out which ones function best under loaded ISP or server-type conditions. John