I have a PC with 64 GB of RAM in my work. I am noticing that there is something that is taking a lot of my memory, sometimes 20 GB or even more than 40 GB. I could not find which process is responsible for that using top
or htop
. I tried also using the suggestions in this link.
None of them worked. So far I was not able to track which program is triggering this. I run MATLAB on this computer, using pieces of codes that can take 20 or 40 GB, but supposedly after I close the program, the memory should be released. I accessed this computer via SSH from Windows 10 this weekend to use MATLAB, but I closed it before closing the SSH session.
I heard that sometimes programs that crash may not release the memory they are using, but I have no idea of how to free this memory now.
Something that I also find odd is that when I use htop
, it runs quite slow when this memory is taken. It take several seconds to process each command I give, like sorting the processes by % of memory. The only thing that worked so far is restarting the computer. But the hard disk is encrypted and I cannot restart it remotely, so I need to wait when I come in front of it, which is not always possible. Besides, while I am accessing this computer remotely I might need maybe 90% of the 64 GB of RAM.
Following a suggestion from a user from another forum, I paste here a recent set of memory check. Right now it is taking 20GB without apparent reason. Here is the output:
$ps xua --sort -%mem | head -20
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
cayo 2493 0.5 0.9 4535480 643612 ? SNsl Nov16 17:44 /usr/bin/gnome-shell
cayo 4507 1.0 0.7 5064236 476568 ? Sl Nov16 31:15 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --extension-process --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=14 --no-v8-untrusted-code-mitigations --shared-files
cayo 3121 0.0 0.5 3024512 356900 ? Sl Nov16 0:20 /usr/bin/gnome-software --gapplication-service
cayo 4228 0.8 0.5 1039056 347068 ? SLl Nov16 27:33 /opt/google/chrome/chrome
cayo 4310 0.5 0.4 1572332 276192 ? Sl Nov16 16:41 /opt/google/chrome/chrome --type=gpu-process --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --enable-crash-reporter=, --gpu-preferences=MAAAAAAAAAAgAAAQAAAAAAAAAAAAAAAAAABgAAAAAAAQAAAAAAAAAAAAAAAAAAAACAAAAAAAAAA= --shared-files
cayo 328586 0.0 0.3 1245240 213464 ? Sl Nov17 0:50 evince /home/cayo/Dropbox/SHARC_Manual.pdf
cayo 66800 0.0 0.2 1602744 187080 ? Sl Nov16 1:19 evince /home/cayo/Dropbox/molpro_2019_manual.pdf
cayo 295144 0.0 0.2 4760688 186336 ? Sl Nov17 0:55 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --extension-process --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=567 --no-v8-untrusted-code-mitigations --shared-files
cayo 572898 0.8 0.2 8947928 185188 ? Sl 13:17 0:08 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=849 --no-v8-untrusted-code-mitigations --shared-files
root 502 0.1 0.2 251700 181960 ? S<s Nov16 5:18 /lib/systemd/systemd-journald
gdm 2034 0.0 0.2 3981684 181072 tty1 Sl+ Nov16 1:09 /usr/bin/gnome-shell
cayo 575117 3.9 0.2 4780680 163852 ? Sl 13:27 0:19 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=866 --no-v8-untrusted-code-mitigations --shared-files
cayo 295027 0.0 0.2 4710288 163824 ? Sl Nov17 0:10 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=562 --no-v8-untrusted-code-mitigations --shared-files
cayo 304946 0.0 0.2 4725024 163512 ? Sl Nov17 0:18 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=591 --no-v8-untrusted-code-mitigations --shared-files
cayo 307875 0.2 0.2 4759024 161492 ? Sl Nov17 4:11 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=634 --no-v8-untrusted-code-mitigations --shared-files
cayo 309837 0.1 0.2 8916036 158696 ? Sl Nov17 1:34 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=649 --no-v8-untrusted-code-mitigations --shared-files
cayo 324033 0.5 0.2 4695768 143456 ? Sl Nov17 7:58 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=679 --no-v8-untrusted-code-mitigations --shared-files
cayo 309811 0.0 0.2 4689916 142408 ? Sl Nov17 0:56 /opt/google/chrome/chrome --type=renderer --field-trial-handle=12489594871761196763,14569705314115548721,131072 --enable-features=UsernameFirstFlow --lang=en-US --enable-crash-reporter=, --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=648 --no-v8-untrusted-code-mitigations --shared-files
cayo 2516 0.7 0.2 2138092 141080 ? Sl Nov16 22:28 /opt/teamviewer/tv_bin/TeamViewer
If I sort by rss
or share
I get basically the same processes on the output.
As far as I understand, there is nothing here that explains 12 GB of memory being used somewhere, that makes even using htop
slow. If I take the first 30, they sum up to 6%, which should be about 4GB.
Thank you a lot for any suggestion on how to free this memory or finding what is taking it.
Results from top
:
top - 17:09:55 up 2 days, 7:38, 1 user, load average: 0.49, 0.53, 0.54
Tasks: 32764 total, 1 running, 32763 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.9 us, 4.9 sy, 0.0 ni, 92.2 id, 0.0 wa, 0.0 hi, 0.1 si, 0.0 st
MiB Mem : 64263.2 total, 25223.8 free, 21777.0 used, 17262.4 buff/cache
MiB Swap: 976.0 total, 976.0 free, 0.0 used. 41425.5 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
620146 cayo 20 0 49772 41032 3372 R 76.9 0.1 0:01.22 top
4507 cayo 20 0 9332100 538308 248716 S 2.6 0.8 38:58.64 chrome
48 root 20 0 0 0 0 S 1.3 0.0 0:04.66 ksoftirqd/6
4316 cayo 20 0 379760 113120 70444 S 1.3 0.2 19:13.50 chrome
1 root 20 0 171616 14236 8468 S 0.0 0.0 10:44.97 systemd
and results from df -h | grep tmpfs
:
tmpfs 6.3G 2.3M 6.3G 1% /run
tmpfs 32G 278M 32G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 32G 0 32G 0% /sys/fs/cgroup
tmpfs 6.3G 64K 6.3G 1% /run/user/1000
tmpfs 6.3G 20K 6.3G 1% /run/user/120
Even if I clean the buff/cache with # sync; echo 1 > /proc/sys/vm/drop_caches
nor # sync; echo 3 > /proc/sys/vm/drop_caches
it doesn't take this 20GB out.
I paste also the result of free
:
$ free
total used free shared buff/cache available
Mem: 65805532 22426248 41734136 342556 1645148 42322332
Swap: 999420 0 999420
Update: today it is taking 27Gb... The computer was simply left on from yesterday to today without anything else than chrome open.