Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm using ubuntu to run a Minecraft server, and I've been having memory usage problems lately, so I set up sysstat to log usage data every 10 minutes. However, I've been noticing some major inconsistencies between the readouts I get from sysstat and top.

For example, here is a sysstat entry (memory):

12:00:01 AM kbmemfree kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit
12:40:01 AM   3244352    813524     20.05     34192     95664    766952     18.90

And here is a readout from top, taken within 10 seconds of the above entry:

 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                                                            
 1291 root     20   0 3758m 568m  12m S   39 14.3   3:43.08 java                                                                                                                                                                
 1 root        20   0 23712 1832 1232 S    0  0.0   0:00.50 init                                                                                                                                                                
 2 root        20   0     0    0    0 S    0  0.0   0:00.01 kthreadd                                                                                                                                                            
 3 root        RT   0     0    0    0 S    0  0.0   0:00.01 migration/0                                                                                                                                                         
 4 root        20   0     0    0    0 S    0  0.0   0:00.01 ksoftirqd/0                                                                                                                                                         
 5 root        RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/0                                                                                                                                                          
 6 root        RT   0     0    0    0 S    0  0.0   0:00.00 migration/1                                                                                                                                                         
 7 root        20   0     0    0    0 S    0  0.0   0:00.02 ksoftirqd/1                                                                                                                                                         
 8 root        RT   0     0    0    0 S    0  0.0   0:00.00 watchdog/1                                                                                                                                                          
 9 root        20   0     0    0    0 S    0  0.0   0:00.64 events/0                                                                                                                                                            
10 root        20   0     0    0    0 S    0  0.0   0:00.04 events/1                                                                                                                                                            
11 root        20   0     0    0    0 S    0  0.0   0:00.00 cpuset                                                                                                                                                              
12 root        20   0     0    0    0 S    0  0.0   0:00.00 khelper                                                                                                                                                             
13 root        20   0     0    0    0 S    0  0.0   0:00.00 netns                                                                                                                                                               
14 root        20   0     0    0    0 S    0  0.0   0:00.00 async/mgr

At any given time, they seem to be way off from each other. I don't have a full grasp on virtual vs resident, etc, but it seems strange that top has no output corresponding with the 813524 "kbmemused" from sysstat. The %memused isn't even close either. And s you can see, java is the only process taking any significant amount of memory.

share|improve this question

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.