[SunHELP] memory leak under Solaris 7

Dale Ghent daleg at elemental.org
Mon Mar 11 23:11:55 CST 2002


On Mon, 11 Mar 2002 bigj at flatwan.net wrote:

| Nah, not actually the system as a whole (don't you hate it when people
| ask questions and don't give you enough 411?). Good example. I just
| compiled irc, pidentd, webalizer, libpng, gd, zlib and install a
| precompiled package. When I started I had 68 megs of 128 megs free (keep
| in mind this in an idle system this time of night).
|
| When I was done I had 28 megs free. As of this writing it's down to 24
| megs. Nothing is running that is spawning enough children to chew up this
| amount of space.

Solaris internals are straight-forward to a degree, but there's things
in the kernel that can make memory useage grow somewhat even on an idle
system... network socket caching, disk buffer, whatever. A good reference
on how all this stuff interplays in the kernel is the book I posted the
url to a few days ago here, "Solaris Internal Archetecture" (or a title to
that effect, it's late and I cant recall the exact name... check the
archives :)

If you want to see a cool trick... As root, cd to the root directory of a
filesystem that has had alot of I/O happen on it... /usr for instance. In
another window, open up 'top' on that machine and leave it running... note
the memory readout. In your other window, do:

cd /usr ; umount .

The umount will fail of course, with a "fs busy" error, but you should see
a good bit of memory suddenly freed in top. This is what I use to drive
home the point to customers that freak out over all their 4GB of RAM is
being sapped because of 'some memory leak' :)

That works, btw, because the un-mounting process first syncs the disk
buffer to that filesystem, and removes that filesystem's buffer cache from
kernel memory... which succeeds. When it then tries to actually unmount
the fs, it fails... which is what you want, because you wouldnt want to
unmount /usr or some other mportant fs on a running system :)

| My next question is this, if I slap in a Solaris 8 CD and do an upgrade,
| how does this effect my current stuff I've compiled under 7? Wil they
| still run?

Sure they should. Sun guarantees binary compatibility when up-reving your
OS. Even SunOS 4.x binaries should theoretically still work on a Solaris 8
machine.

But dont expect a binary built on Solaris 8 to work on 7 or 2.6.

/dale



More information about the SunHELP mailing list