Date: Mon, 17 Nov 2008 11:45:52 -0800 From: "Daniel Howard" <dannyman@toldme.com> To: "Jeremy Chadwick" <koitsu@freebsd.org> Cc: perryh@pluto.rain.com, freebsd-questions@freebsd.org Subject: Re: root /etc/csh Message-ID: <2a5241e00811171145y65e421e8q1210604d8be169b4@mail.gmail.com> In-Reply-To: <20081116104103.GA98266@icarus.home.lan> References: <20081110203643.GH27646@obspm.fr> <Pine.GSO.4.63.0811102239200.846@hmacs.cmi.ua.ac.be> <4ad871310811101530p7b2baa0fk7f7b5118e314c11d@mail.gmail.com> <4918CE42.3050504@ccstores.com> <20081115061957.GA10998@ourbrains.org> <20081116023239.GA89267@icarus.home.lan> <20081116033624.GA13618@ourbrains.org> <20081116050107.GA91940@icarus.home.lan> <491fd833.zbV%2Bim4fHqUJ5RRJ%perryh@pluto.rain.com> <20081116104103.GA98266@icarus.home.lan>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 16, 2008 at 2:41 AM, Jeremy Chadwick <koitsu@freebsd.org> wrote: > On Sun, Nov 16, 2008 at 12:22:11AM -0800, perryh@pluto.rain.com wrote: [...] >> > A statically-linked version of bash would waste significant amounts >> > of memory, while a dynamically-linked/shared version would ease that >> > pain. The same applies for any static vs. dynamic program. >> >> How so? Wouldn't a single in-memory instance of the bash text >> segment be shared among all bash processes, across all users? > > http://lists.freebsd.org/pipermail/freebsd-stable/2007-August/thread.html#36647 http://lists.freebsd.org/pipermail/freebsd-stable/2007-August/036654.html "In response to the original post: The kernel's ELF linker/loader for executables will share the text and read-only segments for static executables." This is consistent with my understanding. A statically-linked bash will consume more space on disk, and more memory the first time it is loaded, but as with any other executable, the executable portion of the program will be re-used each time another bash is run. But I am not a developer or a kernel engineer, so if there is a way in which a statically-compiled bash ends up consuming more memory on each invocation for some reason, I'd appreciate an explanation as to why. Sincerely, -daniel -- http://dannyman.toldme.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2a5241e00811171145y65e421e8q1210604d8be169b4>