Mysql filling all the buff/cache memory

The more time the server run, the more buff/cache Mysql processes use, i'm at 95% right now and only a server reboot free the buff/cache memory. None of the mysql commands free it on the go.

Is it a normal behavior? What if my others processes need memory and Mysql use all the remaining with the buff/cache ? Will it unclaim it automatically or the server will just probably crash...?

top

htop


Your htop screenshot is very difficult to read. Unfortunately, capturing text does not help as the colors are significant. See also: What exactly do the colors in htop status bars mean? For the benefit of the less-sighted: the Mem line is 12 lines of green used, 1 of blue buffers, and 70 of yellow/orange cache. 950M used of 7.6GB. No swap.

This use of all available RAM for caches is normal. DRAM is much faster than permanent storage, which provides a performance boost. Memory will be reclaimed on demand, from caches first.

Observe it yourself. Run something that would use some memory, like applying software updates. Watch it not crash. See if reclaim has a noticeable impact on performance.


That's OS caching, not MySQL.

In general, a "cache" is designed to release the space when someone needs it. So having lots of space consumed by a cache is not the same as "running out of RAM".

Specifically, MySQL seems to be using a meager 1GB of the 8GB. See Wilson's requests for more on what we can point at to say that you are not in trouble.