Solved

Ubuntu server: How can I see what processes are using memory?

Posted on 2009-07-09
8
1,393 Views
Last Modified: 2013-12-16
I'm trying to figure out what's eating all 4G of memory on my server but top/vmstat/free/ps auc, etc. aren't really telling me anything.
I can see that the system is using all the ram, but I can't tell exactly *what* is using it.
I've tried stopping mysql (which I would have thought was the culprit) but that didn't help.
If you look at the output below, top only shows mysql using 7.2% of memory...what's eating the rest of it?
Examples:
top - 19:18:03 up  6:00,  1 user,  load average: 1.06, 1.22, 1.34
Tasks: 151 total,   1 running, 150 sleeping,   0 stopped,   0 zombie
Cpu(s):  1.5%us,  3.6%sy,  0.0%ni, 73.0%id, 21.9%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3873336k total,  3757576k used,   115760k free,     7596k buffers
Swap:  2610520k total,    17328k used,  2593192k free,  3362408k cached
 
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
17230 mysql     20   0 1853m 271m 2504 S   16  7.2   8:00.20 mysqld
17483 root      20   0 13732  11m  944 S    1  0.3   0:11.53 syslog-ng
18395 www-data  20   0 34588  10m 4300 S    1  0.3   0:02.58 php
18424 root      20   0 34588  10m 4316 S    1  0.3   0:02.57 php

Open in new window

0
Comment
Question by:cdukes
  • 3
  • 3
  • 2
8 Comments
 
LVL 8

Accepted Solution

by:
stefanx earned 250 total points
ID: 24819245
Most of your RAM is probably used in buffers that the kernel determines. You see the amount with the free command.
Keep in mind that having RAM that is not used is a waste, so having a  large amount of RAM used by buffers is pretty normal ;)

With Top (in case you don't know), you can sort the applications by memory usage by pressing M

Not what you're looking for I'm sure, but maybe slightly helpful
0
 
LVL 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 250 total points
ID: 24819260
On Linux often the balance of the RAM will be "absorbed" by cache, though it is technically free.

Look at the output of "free"

The memory in the -/+ buffers/cache line under "free" column is technically free.

0
 

Author Comment

by:cdukes
ID: 24819307
@stefanx
Understand that it's not a waste - but I have the VMware ESX team asking me why my server is taking up 4G of ram :-)

@mrjoltcola
So by "technically free" you mean there's 3448584 free? (as noted in the output below)
# free
             total       used       free     shared    buffers     cached
Mem:       3873336    3739956     133380          0      16248    3298956
-/+ buffers/cache:     424752    3448584
Swap:      2610520      18544    2591976

Open in new window

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24819329
Correct. And you can run some experiments by starting up some process and watching the cache "free" shrink.
0
 

Author Comment

by:cdukes
ID: 24819485
Oddly...if I log into webmin, it shows mem usage at:
3.69 GB total, 488.22 MB used
This is weird...?
If I look at the vmware esx server it shows memory usage at 3.2g
Is there anything I can do to make the vmware team feel better?
0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24819703
>>Is there anything I can do to make the vmware team feel better?

I don't know. Educate them on Linux? Why are they worried, is there some sort of system performance problem?
0
 

Author Comment

by:cdukes
ID: 24820009
Yeah...good point. I've supplied them with my findings, thanks for your help!
0
 
LVL 8

Expert Comment

by:stefanx
ID: 24820237
Mybe your VMWare team should just assign you less memory?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question