Date: Thu, 3 Aug 1995 11:38:05 -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: <199508031934.AA10594@diamond.sierra.net>
next in thread | raw e-mail | index | archive | help
> to do about it. Ironically, shared libraries are supposed to help this > situation, but in FreeBSD they are so un-optimally ordered that applications > wind up consuming as much memory as they would if built non-shared (static). > The solution to this problem is to order the routines so that commonly used > ones are all grouped together, and further group together related routines. > This is difficult for two reasons: first, we don't have the statistics to know > how to order the routines properly, and second, our library build procedure > really doesn't allow for this. > > -DG This is probably a duplicate message, and if so please ignore it. I'm still learning how to use my easy-to-use Windows software, as I haven't been able to get the user-level PPP package working on my FreeBSD 2.0 side (and was unable to build and run the 2.0.5 kernel due to numerous incompatibilities--who said it was a minor maintenance release?) Shared libraries in FreeBSD are MAPPED by ld.so using the mmap() function, with copy-on-write and text (code) pages marked read-only. That means that pages (4 KB chunks) are occupied as they are accessed, on the fly, and only the data and bss pages are duplicated, which means the whole thing works in as page-efficient a manner as is humanly possible, with virtually no human intervention. Anyway, that's how it's supposed to work, and mmap() syncs files on disk properly, so I have no reason to doubt it on this. I have 8 MB of RAM and 16 MB of swap partition, and from the sound of it, my machine acts a lot like machines with 32 MB! How can this be? My general impression is, that my system acts like the kernel were using the total amount of virtual memory allocated to processes, rather than the number of pages actually occupied at the moment, as the basis for deciding when to swap. Which is crazy. The whole idea of swapping is to swap out occupied pages, when no unoccupied pages are left available, to make room for pages that need to be occupied right away. With mmap(), which the kernel also uses internally to launch processes and give them additional virtual memory, pages only need to be occupied as they are accessed. Right? Am I missing something?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199508031934.AA10594>