Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
The used memory was 22GB i ran rsync command then it starts eating my memory.. i kill -9 rsync.. the used memory was increased but never reduced after killing the rsync process –  AlBouazizi Jul 8 '11 at 8:17
1  
... Why did you kill -9 rsync?! rsync has proper mechanisms for shutting down, and kill -9 is never one of them. –  Ignacio Vazquez-Abrams Jul 8 '11 at 8:19
    
Why i kill -9 rsync? boz i noticed it is taking lots of memry i will be running out of mem.. is there other way to stop rsync? thank you for your reply –  AlBouazizi Jul 8 '11 at 8:25
1  
Uh, yes. Ctrl-C. –  Ignacio Vazquez-Abrams Jul 8 '11 at 8:26
    
Or even just plain kill without the -9, or kill -2 if you want the exact same effect as ctrl-C, but you don't have an open terminal connected to the process. –  Dave Sherohman Jul 8 '11 at 10:08
add comment

3 Answers

up vote 7 down vote accepted

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.

share|improve this answer
    
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 8 '11 at 13:16
add comment

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!".

share|improve this answer
    
@Abrams: thank you, i have ran top with shift o then N it show many smbd owned by root which was not seen it top only? can you explain please? –  AlBouazizi Jul 8 '11 at 8:33
    
+1 for link explaining Linux's aggressive caching policy. –  Dave Sherohman Jul 8 '11 at 9:56
add comment

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.

share|improve this answer
    
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 8 '11 at 8:47
    
Don't attach an image, just copy and paste the test--it's much easier to read that way. –  Flimzy Jul 8 '11 at 8:50
    
@AlBouazizi: Apparently you forgot to read the bit in my answer that I told you not to forget... –  Ignacio Vazquez-Abrams Jul 8 '11 at 8:56
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.