Hello I have a similar issue, high Ram used (97%) with samba and also experience
some network disconnections.
I first started to notice network disconnections randomly a while back it could happen when not even doing anything online it would go up and down like a yoyo and then a minute or so it would be ok, is this your experience?
I did a further test when this occurred yesterday, checked another 2nd PC hard wire Ethernet connected to the same openwrt router and it remained solid so I think it still could be my network Ethernet port on the PC that is gone bad, I will install a separate card and see how it goes since its so random its hard to tell but in my case it could be a failing network card.
It might be worth you trying the same test as I did above to rule out a possible bad network card also use a network cable tester (mine were fine)
There is also a post here which allows you to flush it, not sure how to do it as a scheduled command that may help you.
Again not 100% on all this above but it is a frustrating issue. I am also on latest openwrt x86 build.