0

enter image description here

Attach is the screenshot of htop program. The memory usage always increase, but I could not find what program is eating my RAM. Afterwards, only 200MB memory left free :'(.

Could you give me some hints to fix this problem?

Update:

I stop all the processes I know (in fact there is only one process I ran), wait about 30 minutes and do

free -m total used free shared buffers cached Mem: 15039 14687 352 0 1 16 -/+ buffers/cache: 14669 370 Swap: 0 0 0

It seems to me that the memory free space will never come back.

Update 2

ps aux --sort -rss | head USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 1060 0.0 0.0 279756 3320 ? Sl 15:11 0:00 /usr/lib/policykit-1/polkitd --no-debug ubuntu 1830 0.0 0.0 21808 3240 pts/1 Ss 15:12 0:00 -bash root 751 0.0 0.0 10220 2296 ? Ss 15:11 0:00 dhclient -1 -v -pf /run/dhclient.eth0.pid -lf /var/lib/dhcp/dhclient.eth0.leases eth0 root 1054 0.0 0.0 344384 2264 ? Ssl 15:11 0:00 NetworkManager root 1 0.1 0.0 33760 2072 ? Ss 15:11 0:03 /sbin/init root 1327 0.0 0.0 287352 1712 ? Sl 15:11 0:00 /usr/lib/accountsservice/accounts-daemon ubuntu 20475 0.0 0.0 17324 1424 pts/1 R+ 15:48 0:00 ps aux --sort -rss syslog 942 0.0 0.0 262132 1328 ? Ssl 15:11 0:00 rsyslogd root 530 0.0 0.0 51928 1268 ? Ss 15:11 0:00 /lib/systemd/systemd-udevd --daemon ** Update 3: **

Results of sudo slabtop

2 Answers2

1

A good way is to check the processes with the largest RSS

ps aux --sort -rss | head

..or use tools such as slabtop to see where memory is being used on the Linux slab allocator:

sudo slabtop
1

Your memory is probably being used as a RAM disk (https://en.wikipedia.org/wiki/RAM_drive).

Type df -h. Do you see a "tmpfs" that is mounted on either /dev/shm or /run/shm? If so, that is your memory being used for that file system.

In the past, I have stored frequently accessed files there (Note: the files are deleted when you reboot). I don't remember the details about it, but it supposedly adjusts in size as you use memory. However, I always wondered if I left a file there, whether it will never reclaim that space. Thus, I gave up doing this.

If you search on this site for words like "RAM disk", /dev/shm, or /run/shm (the last one is the location used by older versions of Ubuntu), you will find more information. See for example:

Or this from another site:

(I hope this answers your question about where your memory went. However, my suggestion is to leave it alone at its default size until you read up more about it. I don't remember whether the system relies on it.)

Ray
  • 2,200