8

Im using SUSE, i have 31GB of memory Mem: 31908592k total, 31429632k used, 478960k free, 12176k buffers How do I find out what process are eating up all my memory.

AlBouazizi
  • 559
  • 4
  • 8
  • 17

3 Answers3

9

Looks like you're running free, looking at the first line, and freaking out. That's OK; a lot of people do that.

Ignore the first line of output from free. Really. Linux is very aggressive about caching data from disk, even including "swapped out" virtual memory pages, in RAM and all that cached data is counted as "used" in free's first line, even though it can be made available again in a microsecond (or less, these days) if needed.

You need to be looking at the second line of output from free, the one labeled -/+ buffers/cache:. That's the line which will tell you how much memory is actually tied up by running programs, ignoring what's being used for the moment by buffers and cache.

For example, my machine currently shows:

             total       used       free     shared    buffers     cached
Mem:       3083924    2177300     906624          0     461344     837008
-/+ buffers/cache:     878948    2204976
Swap:      4000148          0    4000148

Although there are only 906624 bytes of RAM sitting completely unused at the moment, there are an additional 461344 bytes of buffers and 837008 bytes of cached data which can be made available more-or-less instantly if something more important (i.e., just about anything) needs the memory, giving me a total of 2204976 bytes actually available to me.

Dave Sherohman
  • 5,383
  • 1
  • 23
  • 31
  • thank you for your reply my question is why i have 30GB used with running anythting? total used free shared buffers cached Mem: 31908592 31407424 501168 0 12176 0 -/+ buffers/cache: 31395248 513344 Swap: 10239968 112 10239856 Im still looking for mem size of 30906256 which program is using this mem, nothing is running at the moment .. that is my question – AlBouazizi Jul 08 '11 at 13:16
8

Run top, then press ShiftO, then N, then finally Enter. Press Q when you want to exit.

And don't forget, "Linux ate my RAM!".

Ignacio Vazquez-Abrams
  • 111,361
  • 10
  • 201
  • 247
1

Use the top command. It shows a list of all processes running, sorted by those which are using the most CPU by default. If you hit shiftM it will change to sort by memory usage instead. You'll see the top memory offenders at the top of the list.

Flimzy
  • 4,374
  • 21
  • 41
  • thank you for you reply.. i even capture the top windows with shift M.. i don't see the process with is taliking a big mem.. i want to show you the captured img .. how is possible to attach the img to my reply to you.. im still new in superuser.. thank you – AlBouazizi Jul 08 '11 at 08:47
  • Don't attach an image, just copy and paste the test--it's much easier to read that way. – Flimzy Jul 08 '11 at 08:50
  • @AlBouazizi: Apparently you forgot to read the bit in my answer that I told you not to forget... – Ignacio Vazquez-Abrams Jul 08 '11 at 08:56