High memory usage - mounting an external USB3 SSD

I have a 2TB USB3 SSD connected to the router. It's mounted and shared using ksmbd (with avahi and wsdd2).
When it's mounted I see the memory usage as below.


When I unmount the SSD, the total memory available increases a lot.

root@QNAP:~# free -m
              total        used        free      shared  buff/cache   available
Mem:         885276      305912      495572       17664       83792      507800
Swap:             0           0           0
root@QNAP:~# free -m
              total        used        free      shared  buff/cache   available
Mem:         885276      528864      200948       17700      155464      284764
Swap:             0           0           0
root@QNAP:~#

Isn't this memory consumption too high for a single mount. Is it some kind of cached memory. If so, can it be lowered as the SSD read/write speed is fast enough. I don't have another big SSD to connect to the second router USB3 port just to see how much it will grow.

Linux will use otherwise unused memory for read cache. If you go with btrfs youll get 1meg per 1gig storage in supporting structures.

2 Likes

Forgot to say that the SSD is F2FS formatted.

Thats ok for me, xfs would have bonus of fast reboot not needing fsck unlike ext2 or f2fs ymmv

1 Like

The kernel is using that memory to cache the contents of the drive, and will reclaim it for other purposes, if the need arises.

No thing to see here, move along!!!

2 Likes