LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Ubuntu VPS quickly running out of ram (https://www.linuxquestions.org/questions/linux-newbie-8/ubuntu-vps-quickly-running-out-of-ram-4175528922/)

Stuffe 12-21-2014 09:47 AM

Ubuntu VPS quickly running out of ram
 
Hello everyone, Im new here and new to linux in general.
So I want to create this bitcoin service and decide to get a VPS. I installed Ubuntu because it seemed to be the easiest version to work with. But then today, as I connect to the server, I cant run anything without some error related to memory. I restarted the server and very quickly the same thing happened again. The bitcoin program takes up more than a GB, but that should be ok, given I have 4GB installed.
This time I restarted the server without running bitcoin and just click around in the GUI, looking at disk and memory usage with different tools. I close them all again and now we are at about 1.5GB of rams already used... I wait for a while and it is slowly climbing up (memory leak?). I then start bitcoin and run the comands posted below. What really gets me is that the sum of the memory percentages should never even reach 50%.
So what is going on? I am considering formatting and creating a swap space (thats for memory overflow, right?) and also go "headless" to save memory and to get rid of all the programs I installed, tried and forgot. But obviously I would like to know that the same problem wont just turn up again. Would any other distro be better suited for my purpose btw?

top -c
Code:

top - 16:12:40 up 44 min,  4 users,  load average: 0.17, 0.21, 0.24
Tasks: 180 total,  2 running, 177 sleeping,  0 stopped,  1 zombie
%Cpu(s):  3.5 us,  0.8 sy,  0.2 ni, 95.5 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:  4048276 total,  3797756 used,  250520 free,  104020 buffers
KiB Swap:        0 total,        0 used,        0 free.  1719816 cached Mem
 Unknown command - try 'h' for help
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM    TIME+ COMMAND
 3678 smartst+  20  0 1729340 301536  43108 S  8.3  7.4  2:19.37 compiz
 1389 root      20  0  271740  44820  11416 S  1.0  1.1  0:42.82 /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
 3818 smartst+  20  0 2000592 1.072g  53408 S  1.0 27.8  1:24.43 bitcoind
    7 root      20  0      0      0      0 S  0.3  0.0  0:09.36 [rcu_sched]
 1560 www-data  20  0  322460  6460    424 S  0.3  0.2  0:00.01 /usr/sbin/apache2 -k start
 3816 smartst+  20  0  24988  1872  1260 R  0.3  0.0  0:02.31 top -c
    1 root      20  0  33900  3288  1500 S  0.0  0.1  0:01.73 /sbin/init
    2 root      20  0      0      0      0 S  0.0  0.0  0:00.00 [kthreadd]
    3 root      20  0      0      0      0 S  0.0  0.0  0:00.06 [ksoftirqd/0]
    5 root      0 -20      0      0      0 S  0.0  0.0  0:00.00 [kworker/0:0H]
    6 root      20  0      0      0      0 S  0.0  0.0  0:00.17 [kworker/u4:0]
    8 root      20  0      0      0      0 S  0.0  0.0  0:04.52 [rcuos/0]
    9 root      20  0      0      0      0 R  0.0  0.0  0:08.02 [rcuos/1]


ps aux --sort -rss

Code:

USER      PID %CPU %MEM    VSZ  RSS TTY      STAT START  TIME COMMAND
smartst+  3818  7.6 27.7 1991752 1122904 ?    SLsl 16:00  1:30 bitcoind
smartst+  3678  8.7  7.4 1729340 301536 ?      Sl  15:46  2:54 compiz
mysql    1199  0.0  1.4 623996 56932 ?        Ssl  15:28  0:02 /usr/sbin/mysqld
smartst+  2666  0.0  1.1 807480 46260 ?        Sl  15:28  0:00 /usr/lib/evolution/evolution-calendar-factory
root      1389  1.4  1.1 271740 44820 tty7    Ssl+ 15:28  0:44 /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
smartst+  2620  0.0  0.8 949096 32968 ?        Sl  15:28  0:01 nautilus -n
smartst+  3464  0.0  0.5 587692 22484 ?        Sl  15:37  0:00 /usr/bin/unity-scope-loader applications/applications.scope applications/scopes.scope commands.scope
smartst+  3576  0.0  0.5 643984 20804 ?        Sl  15:38  0:00 gnome-terminal
smartst+  2420  0.0  0.5 640304 20664 ?        Ssl  15:28  0:00 /usr/lib/x86_64-linux-gnu/hud/hud-service
smartst+  2635  0.0  0.4 595508 20084 ?        Sl  15:28  0:00 nm-applet
smartst+  2431  0.0  0.4 492676 19688 ?        Ssl  15:28  0:00 /usr/lib/unity/unity-panel-service
smartst+  3448  0.0  0.4 803964 18864 ?        Sl  15:37  0:00 /usr/lib/x86_64-linux-gnu/unity-scope-home/unity-scope-home
smartst+  2632  0.0  0.4 638724 18368 ?        Sl  15:28  0:00 /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
smartst+  2410  0.0  0.4 735248 17540 ?        Ssl  15:28  0:00 /usr/lib/unity-settings-daemon/unity-settings-daemon
smartst+  2486  0.0  0.4 590536 17308 ?        Sl  15:28  0:00 /usr/lib/x86_64-linux-gnu/indicator-keyboard-service --use-gtk
smartst+  3806  0.0  0.4 568604 17096 ?        Ssl  15:58  0:00 /usr/lib/unity/unity-panel-service --lockscreen-mode
root      1522  0.0  0.4 322428 16620 ?        Ss  15:28  0:00 /usr/sbin/apache2 -k start
smartst+  3033  0.0  0.3 566704 16164 ?        Sl  15:29  0:00 update-notifier
smartst+  2421  0.0  0.3 474608 15024 ?        Sl  15:28  0:00 /usr/lib/ibus/ibus-ui-gtk3
smartst+  3538  0.0  0.3 1175948 14604 ?      Sl  15:37  0:00 /usr/lib/gvfs/gvfsd-http --spawner :1.7 /org/gtk/gvfs/exec_spaw/2
smartst+  2509  0.0  0.3 516316 13752 ?        Ssl  15:28  0:00 /usr/lib/x86_64-linux-gnu/indicator-printers/indicator-printers-service
smartst+  2379  0.0  0.3 546832 12344 ?        Sl  15:28  0:00 /usr/lib/x86_64-linux-gnu/bamf/bamfdaemon
smartst+  2596  0.0  0.3 336160 12244 ?        Sl  15:28  0:00 /usr/lib/x86_64-linux-gnu/notify-osd
smartst+  2500  0.0  0.2 1159072 12120 ?      Ssl  15:28  0:00 /usr/lib/x86_64-linux-gnu/indicator-datetime/indicator-datetime-service
smartst+  2865  0.0  0.2 451072 12020 ?        Sl  15:29  0:00 telepathy-indicator
smartst+  2424  0.0  0.2 571616 11480 ?        Ssl  15:28  0:00 gnome-session --session=ubuntu
smartst+  3463  0.0  0.2 917652 10780 ?        Sl  15:37  0:00 /usr/lib/x86_64-linux-gnu/unity-lens-files/unity-files-daemon
smartst+  2535  0.0  0.2 476776 10556 ?        Sl  15:28  0:00 /usr/lib/evolution/evolution-source-registry
smartst+  2918  0.0  0.2 252472 10252 ?        Sl  15:29  0:00 /usr/lib/x86_64-linux-gnu/zeitgeist-fts
smartst+  2630  0.0  0.2 399096  9468 ?        Sl  15:28  0:00 /usr/lib/unity-settings-daemon/unity-fallback-mount-helper
smartst+  3504  0.0  0.2 341824  8820 ?        Sl  15:37  0:00 /usr/lib/x86_64-linux-gnu/unity-lens-music/unity-music-daemon
whoopsie  1074  0.0  0.2 435316  8584 ?        Ssl  15:28  0:00 whoopsie
smartst+  2426  0.0  0.1 382692  7484 ?        Sl  15:28  0:00 /usr/lib/ibus/ibus-x11 --kill-daemon


unSpawn 12-21-2014 01:27 PM

Please do not create duplicate threads. That said: first please read the basic user and admin documentation your Linux distribution of choice provides because you should familiarize yourself with the tools you use and how they behave. Linux, the kernel, utilizes resources efficiently. This means it caches as much in RAM as possible. This is a Good Thing. Next install Linux again and make it a headless install. It may take you more time to configure things (and you'll learn from that), it is generally speaking safer (smaller attack surface) and saves resources (smaller memory footprint).

Stuffe 12-21-2014 02:55 PM

Thank you for your reply unSpawn. I am sorry that I ended up double posting, I pressed the back button I suppose and after that I couldn't delete the new post. Could you please delete the other one. As for Ubuntu, is it normal that it uses about 1,5 to 2 GB ram when just rebooted? My bet would be its not and in that case, where did the ram go? Weird that all running "top -c" only shows programs counting for less than 50% of the rams used.

unSpawn 12-21-2014 06:37 PM

Quote:

Originally Posted by Stuffe (Post 5288654)
(..) I pressed the back button I suppose and after that I couldn't delete the new post. Could you please delete the other one.

Well, that teaches you not to use your web browsers "back" button after making a post ;-p Anyway, all taken care of, think no more about it.


Quote:

Originally Posted by Stuffe (Post 5288654)
As for Ubuntu, is it normal that it uses about 1,5 to 2 GB ram when just rebooted?

That's why I told you to install Linux again and make it a headless install. To illustrate that here's what you could approximately save:
Code:

USER      PID  %MEM  VSZ      COMMAND
smartst+  2918  0.2  252472  /usr/lib/x86_64-linux-gnu/zeitgeist-fts
root      1389  1.1  271740  /usr/bin/X
smartst+  2596  0.3  336160  /usr/lib/x86_64-linux-gnu/notify-osd
smartst+  3504  0.2  341824  /usr/lib/x86_64-linux-gnu/unity-lens-music/unity-music-daemon
smartst+  2426  0.1  382692  /usr/lib/ibus/ibus-x11
smartst+  2630  0.2  399096  /usr/lib/unity-settings-daemon/unity-fallback-mount-helper
whoopsie  1074  0.2  435316  whoopsie
smartst+  2865  0.2  451072  telepathy-indicator
smartst+  2421  0.3  474608  /usr/lib/ibus/ibus-ui-gtk3
smartst+  2535  0.2  476776  /usr/lib/evolution/evolution-source-registry
smartst+  2431  0.4  492676  /usr/lib/unity/unity-panel-service
smartst+  2509  0.3  516316  /usr/lib/x86_64-linux-gnu/indicator-printers/indicator-printers-service
smartst+  2379  0.3  546832  /usr/lib/x86_64-linux-gnu/bamf/bamfdaemon
smartst+  3033  0.3  566704  update-notifier
smartst+  3806  0.4  568604  /usr/lib/unity/unity-panel-service
smartst+  2424  0.2  571616  gnome-session
smartst+  3464  0.5  587692  /usr/bin/unity-scope-loader
smartst+  2486  0.4  590536  /usr/lib/x86_64-linux-gnu/indicator-keyboard-service
smartst+  2635  0.4  595508  nm-applet
smartst+  2632  0.4  638724  /usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1
smartst+  2420  0.5  640304  /usr/lib/x86_64-linux-gnu/hud/hud-service
smartst+  3576  0.5  643984  gnome-terminal
smartst+  2410  0.4  735248  /usr/lib/unity-settings-daemon/unity-settings-daemon
smartst+  3448  0.4  803964  /usr/lib/x86_64-linux-gnu/unity-scope-home/unity-scope-home
smartst+  2666  1.1  807480  /usr/lib/evolution/evolution-calendar-factory
smartst+  3463  0.2  917652  /usr/lib/x86_64-linux-gnu/unity-lens-files/unity-files-daemon
smartst+  2620  0.8  949096  nautilus
smartst+  2500  0.2  1159072  /usr/lib/x86_64-linux-gnu/indicator-datetime/indicator-datetime-service
smartst+  3538  0.3  1175948  /usr/lib/gvfs/gvfsd-http
smartst+  3678  7.4  1729340  compiz

See?


Quote:

Originally Posted by Stuffe (Post 5288654)
My bet would be its not

Then you bet wrong ;-p See http://www.linuxatemyram.com/ for short and http://www.tldp.org/LDP/sag/html/sag...ORY-MANAGEMENT for a longer explanation.

Stuffe 12-21-2014 06:53 PM

Really helpful links. turns out about 2GB of ram were used for disk caching.
Many thanks unSpawn!


All times are GMT -5. The time now is 09:25 PM.