rPi3 freezes after some time

can be done using drive manager

SWAP in itself is not a good idea as it slows down the system. Rather, you should look at what exactly is using your memory. And if this is all ok, it would be better in the long term to use a system with more physical memory.

Well, I tried htop and screencapped, not sure if this tells you something but my impression is that it’s empty that’s being something of a resource hog.

you can check memory usage for the top 20 processes

ps aux --sort=-rss | awk '{printf "%-10s %-6s %-8s %-8.2f %-10s %s\n", $1, $2, $3, $6/1024, $4, $11}' | head -n 20

Okay, here are the results. Like I guess it looks like emby is something of a hog.

USER       PID    %CPU     0.00     %MEM       COMMAND
emby       91532  1.2      186.43   19.4       /opt/emby-server/system/EmbyServer
netdata    91540  3.1      160.34   16.7       /usr/sbin/netdata
mysql      91294  0.0      91.22    9.5        /usr/sbin/mariadbd
roonbri+   91770  0.2      74.22    7.7        RoonBridgeHelper
roonbri+   91785  0.3      45.47    4.7        RAATServer
roonbri+   91521  0.0      41.18    4.3        RoonBridge
mpd        91437  0.0      38.00    3.9        /usr/bin/mpd
squeeze+   91488  0.1      21.25    2.2        /usr/bin/squeezelite
dietpi     92066  0.2      18.32    1.9        /usr/sbin/smbd
root       91251  0.0      17.38    1.8        /usr/sbin/smbd
root       91322  0.0      17.38    1.8        php-fpm:
gmediar+   91496  0.1      12.68    1.3        /usr/bin/gmediarender
root       91253  0.0      11.56    1.2        /usr/sbin/smbd
root       91240  0.0      11.38    1.1        /usr/sbin/nmbd
shairpo+   91465  0.6      8.62     0.9        /usr/local/bin/shairport-sync
www-data   91333  0.0      7.66     0.8        php-fpm:
www-data   91335  0.0      7.66     0.8        php-fpm:
www-data   91338  0.0      7.66     0.8        php-fpm:
www-data   91339  0.0      7.66     0.8        php-fpm:

Yap Emby and Netdata

Well, sorry for repeating myself but it seems we know what the problem is and how to fix it. If this continues I’ll buy a new Raspberry Pi with more ram. Thanks for helping me out!

It would be better to use ZSwap…you will have HUGE amounts of writes/reads to the USB/SSD externally with a “swapfile”
Emby is probably chewing up the memory…do you have hardware encoding enabled…it is probably tying to keep the encoded files in /tmp (which is memory space)
A media server with only a gig of RAM is going to struggle…
And a SBC (single board computer) is going to have limited RAM available…