Running out of memory on a Linux system is generally not a sign that there’s a serious problem. Why? Because a healthy Linux system will cache disk activity in memory, basically gobbling memory that isn’t being used, which is a very good thing.
In other words, it doesn’t allow memory to go to waste. It uses the spare memory to increase disk access speed, and it does this without taking memory away from running applications. This memory caching, as you might well imagine, is hundreds of times faster than working directly with the hard-disk drives (HDD) and significantly faster than solid-state drives. Full or near full memory normally means that a system is running as efficiently as it can — not that it’s running into problems.