[PLUG] Question on the "top" command
Jason Dagit
dagit at engr.orst.edu
Thu Jul 18 16:57:52 UTC 2002
If I'm not mistaken this is just the behavior of the GNU libc or the
kernel (I can't remember which at the time). When programs in linux free
their mem the kernel(or libc) knows the memory is free again, but doesn't
always report it as free. Sort of like when you fork() a process. To
your program it appears that you have a copy of every thing your parent
had, but it isn't until you try to access your copy that the OS gives it
to you. This was a huge optimization in System V kernels (I think sysv),
since shells are so common and they have to do a fork() to call exec().
Exec() starts a new program executing, and it never cares about the data
that was previously running in that process.
Anyone know the details a little better?
Jason
On Thu, 18 Jul 2002, Mike Witt wrote:
> Question on the "top" command (Red Hat 7.2) Basically, what if
> anything, does the "Mem:" line actually mean? On my system (with
> 256Meg of ram) it starts out with about 30Meg free, and after I've
> run for a while it looks something like:
>
> Mem: 126704K av, 120388K used, 6316K free, 756K shrd, 2056K buff
> Swap: 522104K av, 57800K used, 464304K free 56796K cached
>
> The first time I run an app that sucks up a lot of memory, the "free"
> mem goes down, but then it *never* comes back up over 10Meg free until
> I reboot the system. Am I actually looking at some kind of memory leak
> in the kernel, is this just an "artifact" of top? (Or do I just not
> understand what "free" memory means?)
>
> -Mike
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
More information about the PLUG
mailing list