+1
300 000 shared files = 2.4 GB in memory (on Linux):
Priva MiB + Share MiB = Total RAM SWAP
2.4 GiB + 1.1 MiB = 2.4 GiB 453.3 MiB
So, each file takes approximately 8,000 bytes or 8 kilobytes (KB) of memory, which is 8000 characters - a short article. That is a lot.
Maybe some of that information can be stored on disk instead and only frequently accessed/modified data in RAM?
If anyone is having problem with so high memory usage, you can:
- stop sharing folders with most files (yes unfortunately until RAM usage is improved) and restart
- consider putting that large amounts of files into archive (not a good practice). For example .tar has no compression and allows quickly extracting particular files if needed.
- using operating system functions or apps to limit the app memory usage and instead forcing it to swap (swap can be to disk or to a compressed ram space - Linux: zram, zswap):
This Linux Debian/Ubuntu command:
systemd-run --scope -p MemoryHigh=512M --user nohup /usr/bin/fopnu &
seems to be causing only 512MB in RAM and rest in SWAP:
Priva MiB + Share MiB = Total RAM SWAP
499.2 MiB + 922.5 KiB = 500.1 MiB 2.3 GiB
CPU usage is around 50% of a 3GHz thread. Quite a lot, only 2 files transferred like 10kB/s :-/