r/linux•
theandycc

Most processes add up to 1000MB of ram, but 1500 is being used (without buffers). Where has it gone?

In gnome-system-monitor (running as root and showing all processes), when I add up all processes using more than 5MB of ram in a spreadsheet, these add to about 1000MB. The total usage is 1.5GB (without buffers - "free" on the terminal says with buffers it is 2500MB)

Here's a screenshot of gnome-system-monitor showing processes, sorted by memory usage. The rest are mostly under 1MB.

Where has this 500MB gone? Some process has to be using it, surely. I'm running Ubuntu with only Firefox and Gnumeric open. Firefox is only using 500MB. I notice "virtual memory" and "resident memory" columns have larger numbers than "memory" in gnome-system-monitor, but these add up to much more ram than I have in the system (4GB).

I have a memory heavy game and this is irritating, my system gets really sluggish when it starts to use my swap partition! Secondly, regardless of where this RAM has gone, how can I reduce the amount it is using so I can get more than 2.5GB for my game?

Posted Jan 10, 2014, 7:30 PM UTC

013
AlucardZero•
11
theandyccOP•

I had a laugh at that a few days ago.

The total usage is 1.5GB (without buffers - "free" on the terminal says with buffers it is 2500MB)

Read the post next time :P

-1
fandingo•

Check out atop (push "m" to switch to memory mode) and then go crazy from the ridiculous detail provided.

2
netblue30•

Secondly, regardless of where this RAM has gone, how can I reduce the amount it is using so I can get more than 2.5GB for my game?

Your best bet would be to switch to a different desktop/window manager. Try to install something lighter in parallel with Gnome, for example LXDE. When you login specify the LXDE session instead of Gnome and see how it behaves. If you don't like it, returning back to Gnome is just a reboot away. Here are some memory data for various WM/DEs:

http://l3net.wordpress.com/2013/03/17/a-memory-comparison-of-light-linux-desktops/

2
idoithere•

Try to install something lighter in parallel with Gnome, for example LXDE. When you login specify the LXDE session instead of Gnome and see how it behaves. If you don't like it, returning back to Gnome is just a reboot away. Here are some memory data for various WM/DEs:

And you are optimizing something that basically only matters during booting. Ram capacity is cheap these days. 4GB or more and you can run a full desktop environments with little worry.

0
caagr98•

What is that telepathy-indicator?

1
twiked•

It's a tray icon for empahy, a chat client.

1
Malvane•

I did the following to add up all my processes RSS fields:

$ ps aux | awk '{sum+=$6} END {print sum}'
6212948
$ free
             total       used       free     shared    buffers     cached
Mem:      16408324    6618132    9790192          0      27696     321424
-/+ buffers/cache:    6269012   10139312
Swap:     16740220    2849472   13890748

The difference is probably stuff not included in RSS as well as anything stored in a tempfs/rootfs file system. No missing memory here, can you try the same to see if your addition was correct?

1
amauk•

Chances are the "missing" 500MB is taken up by shared libraries (Gnome probably).

Memory is hard to conceptualise.
You can't just add things up. It's far more complicated than that.

1
idoithere•

I forgot how ram the kernel uses. Isnt it around 30-50MB?

0
keeperofdakeys•

Resident Memory is the amount that each process physically takes up in RAM, but they shouldn't add up to more than what is in memory. Virtual Memory can be assigned to a process, without it actually being used.

1
AdrianoML•

Try this:

sync && echo 3 > /proc/sys/vm/drop_caches

You will lose all your filesystem cache, but it also reclaims a bunch of other stuff. Works really well after running a java app (like minecraft).

1
asteroid1000•

Gnome is losing memory (malloc), it is a known bug. I am surprised you still get 2.5 GB available for your game, usually you would get less. Try XFCE or LXDE instead.

1