RE: Memory bug in 1.3.84
8 Apr 96 08:47:27 -0500

> From: on Sun, Apr 7, 1996 7:53 PM
> Subject: Re: Memory bug in 1.3.84
> >> It appears that when the kernel returns to a previous state i.e.
> >> down a program. That the reported available memory should be reported
> >> same as the original reporting. However, this is not happening. The
> >> blatent example being the exiting of X-Windows. The kernel with
nothing but
> >> top definately does not use 13+ megs.
> >
> >You might complain that 'free' should be called 'waste'.
> >There really can't be a 'cache' catagory because cache
> >is used to run programs. That leads to "What is cache?".
> Also, when you exit a program, how long should the memory be maintained in
> the "cache"??? If you exit a program and and leave the system (say over
> night) the cache does not decrease. Yet it seems logical that if a user
> not reused the program in say 30 min or 1 hr. that the memory should be
> reassigned to the free memory catagory and the cache forgotten.
> Therefore, this leads me to believe that there is still a bug in the
> management area of linux. If I exit the program, free memory should be
> increased on the display to near the original amount, even if it is held
> cache (since this is still "unallocated" memory at the momment i.e. it is
> not being used by a program). All that the cache needs to carry is just a
> hook to where the old memory is at. Then, if the user reenters the
> BTW, to most people, the term "cache" is interpreted to mean the memory
> is used as a "buffer" to hold the most demanded pages of memory (i.e. disk
> cache, L2 cache, etc). However, linux appears to be redefining it with a
> definition that is contrary to the usual one.
> Chris

On VAX/VMS, there are "hard" page-faults and "soft" page-faults.
HARD meant that the page had to be read in from the disk.
SOFT meant that the page was still in memory, but on the freelist, so all
that was required was to remove it from the freelist (well, actually, the
*buffer* that held the page in question), and put it on the "in-use" list.
The memory display showed all these lists---and the list of
"free-buffers-that-held-a-page-which-was-mirrored-on-a-disk" was counted as
After a program exitted, a page that held program code would be "occupied"
and reading it from disk could be avoided. However, a page that held
dynamic data would indeed be free'd and "unoccupied".

While there may or may not be a bug in Linux's buffer management, I think
part of the confusion could be cleared up by better reporting of the memory
-30- Ray