[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Memory usage on debian



Hans Wilmer wrote:
> On Sat, Jan 25, 2003 at 05:18:46PM -0500, Jason McCarty wrote:
> 
> > > Well, it does :) What is the difference between 'cached' and
> > > 'buffers'? I wanted to know that since long, but never found out.
> > 
> > Well, after digging through the kernel sources (such fun!), I think I
> > figured that out. "cached" is files that have been read from disk, but
> > aren't currently opened by any processes. "buffers" is the same, except
> > it counts opened files instead.
> 
> Thanks for the info! Do files contributing to buffers contribute to
> cache at the same time?

The way free accounts it, there's no overlap, although the kernel
internally treats buffers as a subset of cache.

> > > What wonders me it the memory usage of Xfree86. It seems that with
> > >   492 root       7 -10  560M  15M   836 S <   0.0  3.1 219:38 XFree86
> > 
> > Hmm, I would guess that the actual memory X is using is SIZE-512, so the
> > actual usage would be 48M.
> 
> This would make a negative number of memory usage shortly after
> starting the X server :)

Doh! Wouldn't that be cool though :)

> > I have a 64MB video card, and X maps it as 4 times the actual size,
> > so that my SIZE is 270M, but X really only uses 14M.
> 
> This would explain a lot! My card has afair 128 MB, accounted as 512
> MB plus 15 MB adds up to 527 --- plus some other memory actually used,
> but swapped out, plus maybe a little memory due to leaks.
> 
> > That doesn't mean X doesn't leak, of course ;-) The problem might
> > just be that resource leaks in X programs cause memory leaks in the
> > X server.
> 
> Hm, they shouldn't do that ...

Well, most of an X program's pixmaps and other GUI info is stored on the
X server. So if a program doesn't tell X when to discard them, X thinks
they're still in use, and doesn't free them.

So leaky X programs make your X server leak. It's not really X's fault,
since it can't do much about it. It might be able to clean up some when
programs exit, I'm not sure.

Jason



Reply to: