Skip site navigation (1)Skip section navigation (2)
Date:               Thu, 3 Aug 1995 15:34:28 -0800
From:      "Jim Howard" <jiho@sierra.net>
To:        davidg@root.com, freebsd-questions@freefall.cdrom.com
Subject:         Re: 2.0.5 Eager to go into swap 
Message-ID:  <199508032331.AA27711@diamond.sierra.net>

next in thread | raw e-mail | index | archive | help
>    Yes, you completely missed the point I was making above.
>    Shared libraries are large and contain mostly things that your program
> doesn't use. Since the routines that it does use are spread out over the
> entire library, applications tend to fault in a whole page of stuff when only
> a handful of bytes is actually needed. This has two affects: first, in a short
> time, the entire shared portion of the library is faulted in (and when
> considering all of the libraries, including X, might be megabytes more stuff
> than is actually needed), and second, applications end up consuming a lot more
> private memory because of the copy-on-write that occurs on the data pages and
> the sparse references to the .bss pages. All of this together results in
> little, none, or negative memory savings over simply having everything built
> non-shared (which implies that only those functions actually used by the
> problem will be compiled in).
>    The only solution to this problem is to order the shared libraries in such
> a way that things are grouped to make accesses as concentrated as possible.
> That is what Linux does, and that is one reason why it generally uses less
> memory than FreeBSD. Another reason is that it's malloc actually works right
> (unlike ours which often uses twice as much memory as is needed).
> 
> -DG

Well, I guess that phenomenon helps explain why some processes show a
larger "run time set size" than "virtual memory size" in the output from ps.

But those differences are small, and they still don't explain  the horrendous
swapping generated by X, unless the decision to swap is totally blind to
page sharing, which makes no sense.

And don't FreeBSD and Linux pretty much use the same XFree86 libraries, 
with the same ordering of contents?  It's supposed to be better with ELF,
but the older Linux library scheme was a mess, it required libraries to load
at fixed, bureaucratically-registered addresses.  I had more trouble running
out of swap with X under Linux than I've had under FreeBSD.

About malloc(), whose and which malloc() are you talking about, and why
doesn't it "work right"?

This all seems to be degenerating into a useless flap without addressing 
the original issue much.

I remember reading a gripe column in BYTE,  where a networking support
guy at Cray was complaining because customers wanted to run X on
laptops and he couldn't do it for them.  He recalled a time when X ran fine
on Suns with 4 MB of RAM.  Now we have a user who likes FreeBSD 
because it runs X fine with 16 MB (although others dispute that even with
32 MB).  I don't see where the basic server (extensions aside) has acquired
much new functionality to account for the difference.  It's just quadrupled
in size and extrapolated its RAM requirements.

Maybe that's why nobody wants to deal with this issue--it collapses into a
flame war and nobody can do anything about it anyway!



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508032331.AA27711>