Jason Stelzer on 28 Dec 2008 17:27:59 -0800 |
Before you obsess with the numbers in top, is your machine doing what you expect it to do? Once memory is allocated, the kernel will keep it around for use as buffer/cache. Your 'free' memory, that stuff that hasn't been allocated yet, is essentially wasted. Over time, you'll see the vast majority of your memory is 'used'. Not all of that memory is actually in use. For more accurate memory stats, you could check out the 'free' command or maybe vmstat/pmap. Actually, its a bit more complicated than that. Take for instance, a shared library. If you're looking at the output of pmap, how do you count the ram used for the shared libary? If its the only process using it? If it isnt? Take a close look at a few different processes via pmap. Notice any /dev mappings? X11 has this wonderful tendency to map the video memory into its address space (so that it can use it) making it look HUGE in top. Also, those pixmaps in all those X11 apps? X11 maps those and gets 'credit' for that memory usage too. I still think it's unfortunate that device mappings show up as consumed memory. It causes a bunch of x11/firefox complaints that aren't really well founded. The real issue is that when you want to know exactly how memory is allocated, it turns into a rats nest of details. Or, maybe, nobody has written a decent memory profiler that has a 'detail' mode that really lays it all out? If you're concerned that something is leaking, you can always gather stats via ps and free. If the vsize of a program is continually sloping upward, you probably have a leak. If you're like me and have pretty consistent usage patterns, your memory use will plateau after the box has been up for a while. At that point all the shared libaries and whatnot are loaded into memory. At that point, if you're swapping hard, its time for ram. If you're not, then beyond fork bombs and program errors causing leaks, you're probably fine. This isn't a linux specific problem really. My mac and windows box are the same in a lot of ways. I generally just use the systems in whatever ways I plan on using them and dont worry too much about memory usage unless its getting sluggish or having an actual problem. Dont get me wrong, its valuable to understand where your ram is going, but just keep in mind that top can be a bit misleading unless you understand how the plumbing works. On Sat, Dec 27, 2008 at 5:12 PM, jeff <jeffv@op.net> wrote: > XUBUNTU IMPERSONATES WINDOWS > > I don't shut my desktops down. Lately I've been noticing humongous > amounts of memory being used with almost no apps open. Even when I > close all the GUI apps, it still indicates north of 70%. I initially > figured it was Firefox leaking memory but I shut it down. Htop > indicated it was xorg. > > I realize there are a certain amount of resources necessary to put > things onscreen for a few days/weeks, but there used to be a time when I > couldn't tell you the last time I rebooted. Now it looks like a week or > more. I thought it might be dual monitor systems but it occurs with > single monitor systems too. Is something not releasing RAM or does xorg > think it will gain greater market share by behaving like Windows? > > All of the systems are Xubuntu 8.10 but I remember it happening on 8.04 > too. And this is supposed to be the `light' desktop... go figure. > > > > -=-=- > ... The healthcare crisis will end when Congress has to choose an HMO > * TagZilla 0.066 * http://tagzilla.mozdev.org > ___________________________________________________________________________ > Philadelphia Linux Users Group -- http://www.phillylinux.org > Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce > General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug > -- J. ___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
|
|