Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running a Java script on a Fedora Core Release 6 server (Linux 2.6.19-1.2911.6.5.fc6xen x86_64) and am concerned about a lack of memory. The box has 2 GB of memory in total. Running "free -tm" displays the following:

free -tm
             total       used       free     shared    buffers     cached
Mem:          2048        956       1091          0        115        611
-/+ buffers/cache:        229       1818
Swap:          543          0        543
Total:        2591        956       1635

It seems as though around half of the memory is currently being used. When I run the command "ps aux" and "top" though, I cannot seem to find a process or combination of processes that are using the memory. Here are the results from "top":

 5473 root      15   0 63236  19m 2036 S    0  0.9   0:00.33 getAp_StrangeNe                                                                                                      
 1395 root      18   0  214m 9080 5276 S    0  0.4   0:00.18 httpd                                                                                                                
21088 apache    15   0  217m 7160 2944 S    0  0.3   0:00.14 httpd                                                                                                                
21081 apache    15   0  217m 7128 2952 S    0  0.3   0:00.01 httpd                                                                                                                
21085 apache    15   0  217m 7040 2916 S    0  0.3   0:00.01 httpd                                                                                                                
21087 apache    15   0  217m 7040 2916 S    0  0.3   0:00.00 httpd                                                                                                                
21082 apache    15   0  217m 6492 2524 S    0  0.3   0:00.00 httpd                                                                                                                
21084 apache    15   0  217m 6472 2512 S    0  0.3   0:00.00 httpd                                                                                                                
26700 root      18   0  144m 6320 3952 S    0  0.3   0:03.89 php                                                                                                                  
21086 apache    15   0  216m 5652 1800 S    0  0.3   0:00.00 httpd                                                                                                                
21083 apache    18   0  216m 5648 1800 S    0  0.3   0:00.00 httpd                                                                                                                
 4380 root      15   0 73916 2936 2292 R    0  0.1   0:00.00 sshd                                                                                                                 
 4042 root      15   0 73916 2928 2292 S    0  0.1   0:00.01 sshd                                                                                                                 
 5582 postfix   16   0 47572 2508 1984 S    0  0.1   0:00.00 local                                                                                                                
 5579 postfix   16   0 49700 2324 1804 S    0  0.1   0:00.00 cleanup                                                                                                              
 1495 postfix   15   0 49628 2288 1768 S    0  0.1   0:01.73 qmgr                                                                                                                 
 4601 postfix   15   0 49568 2200 1700 S    0  0.1   0:00.00 pickup                                                                                                               
 1492 root      15   0 47412 2104 1616 S    0  0.1   0:03.48 master                                                                                                               
10654 root      15   0 74272 1684  596 S    0  0.1   0:00.08 screen                                                                                                               
10655 root      15   0 65308 1676 1212 S    0  0.1   0:00.05 bash                                                                                                                 
 4044 root      15   0 65184 1596 1172 S    0  0.1   0:00.00 bash                                                                                                                 
 4382 root      15   0 65184 1596 1168 S    0  0.1   0:00.01 bash                                                                                                                 
 5460 root      18   0  100m 1588  836 S    0  0.1   0:00.00 crond                                                                                                                
 1384 ntp       15   0 19760 1296 1024 S    0  0.1   0:00.28 ntpd                                                                                                                 
 1405 root      19   0 73916 1204  552 S    0  0.1   1:50.10 crond                                                                                                                
 5584 root      16   0 16940 1196  892 S    0  0.1   0:00.05 top                                                                                                                  
 1350 root      25   0 26828 1188  904 S    0  0.1   0:00.95 automount                                                                                                            
 5978 root      15   0 16804 1164  892 R    0  0.1   0:00.00 top                                                                                                                  
28831 root      15   0 44284 1072  628 S    0  0.1   0:00.10 sshd                                                                                                                 
 1497 42949672  15   0 35348 1068  720 S    0  0.1   0:01.51 nrpe                                                                                                                 
 5472 root      19   0  8644  940  800 S    0  0.0   0:00.00 sh                                                                                                                   
26557 root      15   0 31096  884  520 S    0  0.0   0:01.71 ssh-agent                                                                                                            
 1149 root      18   0 10104  788  648 S    0  0.0   0:00.00 rpc.statd                                                                                                            
 1181 root      18   0 42000  744  328 S    0  0.0   0:00.06 rpc.idmapd                                                                                                           
  325 root      15  -4 12560  684  364 S    0  0.0   0:00.01 udevd                                                                                                                
    1 root      15   0 10308  680  568 S    0  0.0   0:00.46 init                                                                                                                 
 1129 rpc       15   0  8004  608  452 S    0  0.0   0:20.77 portmap                                                                                                              
 1103 root      15   0  5864  604  484 S    0  0.0   0:11.41 syslogd                                                                                                              
 1499 root      15   0  3760  512  440 S    0  0.0   0:00.00 agetty                                                                                                               
 1424 root      18   0 18668  464  308 S    0  0.0   0:00.00 atd                                                                                                                  
 1106 root      15   0  3760  440  360 S    0  0.0   0:00.00 klogd                                                                                                                
 1199 dbus      25   0 25452  432  216 S    0  0.0   0:00.00 dbus-daemon                                                                                                          
 1117 root      18   0  6436  328  240 S    0  0.0   0:00.66 irqbalance                                                                                                           
    2 root      RT   0     0    0    0 S    0  0.0   0:00.61 migration/0                                                                                                          
    3 root      34  19     0    0    0 S    0  0.0   0:00.20 ksoftirqd/0                                                                                                          
    4 root      RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/0                                                                                                           
    5 root      10  -5     0    0    0 S    0  0.0   0:00.70 events/0                                                                                                             
    6 root      10  -5     0    0    0 S    0  0.0   0:00.00 khelper                                                                                                              
    7 root      10  -5     0    0    0 S    0  0.0   0:00.00 kthread                                                                                                              
    9 root      10  -5     0    0    0 S    0  0.0   0:00.00 xenwatch                                                                                                             
   10 root      10  -5     0    0    0 S    0  0.0   0:00.00 xenbus                                                                                                               
   15 root      RT  -5     0    0    0 S    0  0.0   0:00.66 migration/1                                                                                                          
   16 root      34  19     0    0    0 S    0  0.0   0:00.26 ksoftirqd/1                                                                                                          
   17 root      RT  -5     0    0    0 S    0  0.0   0:00.00 watchdog/1                                                                                                           
   18 root      10  -5     0    0    0 S    0  0.0   0:00.98 events/1                                                                                                             
   58 root      10  -5     0    0    0 S    0  0.0   0:00.00 kblockd/0                                                                                                            
   59 root      10  -5     0    0    0 S    0  0.0   0:00.00 kblockd/1                                                                                                            
   60 root      20  -5     0    0    0 S    0  0.0   0:00.00 cqueue/0                                                                                                             
   61 root      10  -5     0    0    0 S    0  0.0   0:00.00 cqueue/1                                                                                                             
   63 root      20  -5     0    0    0 S    0  0.0   0:00.00 ksuspend_usbd                                                                                                        
   66 root      20  -5     0    0    0 S    0  0.0   0:00.00 khubd                                                                                                                
   68 root      10  -5     0    0    0 S    0  0.0   0:00.00 kseriod                                                                                                              
   99 root      10  -5     0    0    0 S    0  0.0   0:00.70 kswapd0                                                                                                              
  100 root      20  -5     0    0    0 S    0  0.0   0:00.00 aio/0                                                                                                                
  101 root      20  -5     0    0    0 S    0  0.0   0:00.00 aio/1                                                                                                                
  234 root      11  -5     0    0    0 S    0  0.0   0:00.00 kpsmoused                                                                                                            
  262 root      18  -5     0    0    0 S    0  0.0   0:00.00 kmirrord                                                                                                             
  269 root      20  -5     0    0    0 S    0  0.0   0:00.00 ksnapd                                                                                                               
  272 root      10  -5     0    0    0 S    0  0.0   0:25.29 kjournald                                                                                                            
  296 root      11  -5     0    0    0 S    0  0.0   0:00.00 kauditd                                                                                                              
  700 root      14  -5     0    0    0 S    0  0.0   0:00.00 kmpathd/0                                                                                                            
  701 root      14  -5     0    0    0 S    0  0.0   0:00.00 kmpathd/1                                                                                                            
  725 root      12  -5     0    0    0 S    0  0.0   0:00.00 kjournald                                                                                                            
 1230 root      10  -5     0    0    0 S    0  0.0   0:02.87 rpciod/0                                                                                                             
 1231 root      10  -5     0    0    0 S    0  0.0   0:00.00 rpciod/1                                                                                                             
 1232 root      19   0     0    0    0 S    0  0.0   0:00.00 lockd                                                                                                                
 2405 root      15   0     0    0    0 S    0  0.0   0:00.31 pdflush                                                                                                              
28522 root      15   0     0    0    0 S    0  0.0   0:00.00 pdflush 

I don't know a thing about memory management on any operating system, so am unsure if the commands I am using are even fulfilling what information I need. Any suggestions as to what might be happening? Am I misinterpreting what I am being presented?

share|improve this question

migrated from stackoverflow.com Mar 9 '12 at 1:59

This question came from our site for professional and enthusiast programmers.

    
Your system uses swap altho there's still unused RAM. You can tune that by setting /proc/sys/vm/swappiness to 0 (the current value is likely 60). – ott-- May 11 '13 at 16:51
up vote 2 down vote accepted

As I read it your machine is using 229 MB for processes and then is trying to improve its performance by caching 611 MB of disk in memory. Nothing strange here; If it has memory to spare, why not use it?

On a side note, you should expect close to all memory being "used" on any machine that has been running for a while.

share|improve this answer
    
Thanks for clarifying, guess I should have done more research – rallsi23 Mar 5 '12 at 21:44

Look at the +/- buffers/cache line.

The memory usage in the Mem: line includes temporary storage used by the operating system for caching file accesses.

share|improve this answer

This site might be helpful:

Additionally as part of that site there is a pretty thorough explanation of what's going on with the memory usage on Linux:

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .