Environment
Logger Software 7.3.x
OS: RHEL 8.x
Situation
Logger software installed in the RHEL 8.x server used high memory include the swap memory of the OS.
Cause
In the Linux server, physical memory (RAM) and swap space are critical components that manage how applications and processes store and access data temporarily, where memory (RAM) is physical, and swap is is a disk space that acts as an extension of the physical memory (RAM).
When RAM is full, the system moves inactive pages from RAM to swap to free up memory for active processes.
Swap memory in a Linux server is used when the system's RAM is fully utilized, allowing inactive pages from memory to be moved to disk to free up physical memory for active processes.
Swap is slower than RAM because it uses the disk for storage, but it prevents the system from running out of memory and crashing.
When run command free -m like below:
Meaning:
- Total: Total amount of physical memory (RAM).
- Used: Memory actively being used by processes, including cache/buffer memory.
- Free: Memory that is entirely unused by the system at the moment.
- Buff/Cache: Memory used for buffering and caching.
- Available: Memory that can be allocated to new processes without swapping. This includes free memory and part of the cached memory that can be reclaimed.
From the screenshot above, the buffer/cache memory of the OS is 107GB, where the memory used was 80GB -> total memory used was 187 GB.
Since the physical memory already used the whole 187 GB, but the Logger still requires more memory for another tasks, then the OS will first try to free up some of the cached memory if possible. In this case, the speed to free up cache memory not enough with the memory needed by the application. And since the whole physical memory already in used, this is the reason why the swap memory being used and keep increasing.
Find resolution on support portal