Re: Some hard numbers on XFree86 memory usage (and no, not ps/top)
Stuart Anderson <[email protected]>
| Newsgroups | gmane.comp.xfree86.forum |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 19 Apr 2003, Ivan Todoroski wrote:
> Another interesting thing is that the drivers and various modules loaded by
> XFree86 don't show up in the /proc/451/maps file... but there are a few
> anonymous mmap() blocks with the executable flag set, which I'm guessing is
> probably where the code from these modules is kept during runtime.
>
> It looks like XFree86 bypasses somehow the OS shared library loader, instead
> it loads and links those modules manually into it's own allocated memory. This
> would unfortunately mean that they are copied into RAM for each X server
> process - sharing them between multiple X processes would not be possible, but
> on the other hand, running multiple X servers on the same machine is not a
> common scenario, so it's not a big deal. I could be wrong about this, of course.
You are correct. The XFree86 modules and driver are loaded into the heap,
which usually results in am anonymous mmap() by libc's malloc to allocate the
space. Probably a very large portion of the 6.3M allocated just to bring up
the root weave is the size of the loaded modules.
It's been a couple of years since I did this, but a stripped down kdrive
style X server is only 700k or so, and takes less than 1M of RAM to bring
up the root weave. Some numbers are at the URL below. Note that those
were done assuming a non-linux embedded OS where the executable code was
running out of ROM, so the text pages were not included in the size estimates.
http://www.netsweng.com/~anderson/talks/ELECOct2000/img14.htm
Stuart
Stuart R. Anderson [email protected]
Network & Software Engineering http://www.netsweng.com/
1024D/37A79149: 0791 D3B8 9A4C 2CDC A31F
BD03 0A62 E534 37A7 9149