[techtalk] 'Segmentation error' memory problems
rik at kde.org
Mon Mar 27 19:07:59 EST 2000
#if Lighthouse Keeper in the Desert Sun
> [...] My biggest problem with it was that it took ages to start up and
> used loads of my system resources. I couldn't run both it and netscape
> at the same time. (I use Gnome/E, and TOP shows them taking 27% of the
> mem as 'X'. I've got 128 MB swap.) [...]
Um, well top in its default mode doesn't give you real-world memory
You can cat /proc/<pid>/status and read VmExe for the binary size,
VmData for the unshared memory size and VmLib for the shared memory
If you run StarOffice, you might notice that it's divided into several
libraries. This allows Linux to take parts of the 'binary' out of
memory in sections.
Certainly if you have one massive binary and are actually using the
thing, Linux may start swapping other binaries out for you. This
can make your system feel sluggish. StarOffice (and most large
systems) use shared libraries and often dynamic loading to reduce
the amount of code that has to be in memory at one time.
Particularly I've noticed that StarOffice does not use a significant
amount of VmData (heap), which is good - it shows the programmers have
been good about memory efficiency within the app.
I only have 64M in my machine at the moment and find though slow to
start up (due in part to brain-dead GNU ld.so being so crap at
resolving symbols in C++ libraries) it runs nice and fast - no
complaints there at all, and I'm only on a lowly K6/233.
The problem comes when you try to swap to other apps, which have
been, er, swapped :) The solution is to redesign Linux' memory
management and scheduler so that it's optimised for workstations
(desktops) rather than servers. Linux is designed to run non-GUI C
programs and be a server. That's the nature of UNIX, I suppose.
Anyone want to redesign X so that it runs as a realtime process,
including the back end of any GUI toolkits using it ? ;)
More information about the Techtalk