0

Memory and swap are both near maximum. I shut down all the processes I initiated. The memory and swap are still both near maximum. Is there a way to release the memory used by a terminated program? What will happen if I turn swap off then turn it on again (sudo swapoff -a; sudo swapon -a) when memory and swap are both near maximum?

3
  • How are you checking to see if they are at a maximum? Memory may seem to be nearly full, but may not actually be full. Swap should be minimal as possible. Apr 29, 2014 at 3:08
  • The resources tab in the gnome-system-monitor shows memory and swap status. Besides, I said near maximum, not 100%.
    – user227096
    Apr 29, 2014 at 5:03
  • All I know is that when swap is at 100% and memory is above 90%, my computer becomes non-responsive and I am unable to even move the cursor. I once let the computer sit in this state for a few hours before I initiated a hardware reset because the computer was not responsive.
    – user227096
    Jun 2, 2014 at 17:21

1 Answer 1

0

I don't remember if the Gnome System Monitor includes cache files in its memory calculation (I think it doesn't), but you can run free -m to see the actual free memory (on the second row).

             total       used       free     shared    buffers     cached
Mem:          7915       7180        734        134        197       4581
-/+ buffers/cache:       2401       5513
Swap:         4024         87       3937

In my case, I have 5513 MB of RAM free, which 4581 MB of it being pre-cached with files.

Anyways, running sudo swapoff -a && sudo swapon -a when there isn't enough RAM available will just cause the command to fail, and won't do any harm to your system.

To find out what process might still be taking up RAM, sort the column by memory usage, or use top or htop.

You must log in to answer this question.

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